Skip to content

Follow organizations to their new ID when it changes on the server - #36

Merged
evoggy merged 1 commit into
mainfrom
evoggy/org-ids
Oct 8, 2026
Merged

evoggy merged 1 commit into
mainfrom
evoggy/org-ids

Conversation

@evoggy

@evoggy evoggy commented Oct 8, 2026

Copy link
Copy Markdown
Member

Why

On the server, an organization's ID (the org in org/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

  • The server's swarm list includes each swarm's org_uuid, which never changes. cfcli remembers the user's ID for each organization in synced/<server>/orgs.json.
  • When an ID changes, the copies (including changes that aren't pushed) and the selected swarm move to the new ID, and cfcli says so.
  • Using an old ID, typed or selected, fails with what it is called now instead of "not found". When the change is first noticed through a 404, cfcli gets the list to find out.
  • push gets the list first, so kept changes are pushed under the new ID.
  • Servers that don't send org_uuid work as before.

Testing

End to end against a local server instance:

  • A changed ID noticed by swarm config list, and by using the selected swarm (404).
  • Changes made with sync off, then a changed ID, then push.
  • Two organizations swapping IDs.
  • Old IDs in show, push and pull, online and offline.

The 65 unit tests pass. The server side is deployed at https://arc.bitcraze.io.

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.
@evoggy
evoggy merged commit cd89d93 into main Oct 8, 2026
1 check 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.

1 participant