Repository navigation
Follow organizations to their new ID when it changes on the server - #36
Merged
Merged
Conversation
The <org> in a shared swarm's ID is the user's own ID for the organization, which they can change on the server; the people they fly with may use another one. The server lists the UUID of each swarm's organization (org_uuid), which never changes, and cfcli remembers the IDs in synced/<server>/orgs.json. When one changes, the copies (also ones with changes that aren't pushed) and the selected swarm move to the new ID, and using an old ID says what it is called now instead of saying the swarm is gone. push gets the list first, so kept changes are pushed under the new ID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
On the server, an organization's ID (the
orginorg/swarm) is now each member's own. It only has to differ from the IDs of that member's other organizations, so nobody claims a name for everyone, and a member can change their ID for an organization. The people you fly with usually have the same one, but not always.Until now, a changed ID looked to cfcli as if the organization's swarms were deleted and new ones appeared: copies under the old ID were dropped, or left behind if they had changes that weren't pushed, and the selected swarm stopped working.
What changes
org_uuid, which never changes. cfcli remembers the user's ID for each organization insynced/<server>/orgs.json.pushgets the list first, so kept changes are pushed under the new ID.org_uuidwork as before.Testing
End to end against a local server instance:
swarm config list, and by using the selected swarm (404).push.show,pushandpull, online and offline.The 65 unit tests pass. The server side is deployed at https://arc.bitcraze.io.