Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnection and compatibility layer fixes #431

Merged
merged 5 commits into from
Aug 27, 2024

Conversation

julianlocke
Copy link
Contributor

@julianlocke julianlocke commented Aug 26, 2024

While the public route set doesn't include identically named upload/download routes, the private set does. Include namespaces in reconnection helpers to avoid route collisions.
See: https://github.com/dropbox/stone/pull/346/files
Generated code: 3ab4597

Background compatible routes get generated reconnection wrapper types. If they're in the allow list for Objective-C compatibility generation as well, an additional Objective-C wrapper type will be generated. If we generate an Objective C compatibility wrapper for each Swift one, a switch statement used to map from one to the other will contain an unreachable default statement. Since each layer is generated in separate (and potentially parallel) code generation passes, it's difficult make the generation logic smart enough to know whether to include the default. This change eliminates the warning by generating a different control flow that accommodates both situations naturally. See: https://github.com/dropbox/stone/pull/347/files
Generated code: d0058ec

There are a few new variable names that must be suffixed with _ to avoid collisions in the SwiftyDropbox Objective-C compatibility layer (in private routes): hash (colliding with the NSObject var) and client (colliding with our own client vars).
https://github.com/dropbox/stone/pull/348/files
No changes in generated code here.

@julianlocke julianlocke changed the title Generate reconnection helpers including route namespaces. [WIP] Reconnection and compatibility layer fixes Aug 26, 2024
@julianlocke julianlocke changed the title [WIP] Reconnection and compatibility layer fixes Reconnection and compatibility layer fixes Aug 27, 2024
@julianlocke julianlocke merged commit c250782 into master Aug 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants