-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Rework initial settings storage on invitee v2 #1125
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
Open
gmaclennan
wants to merge
15
commits into
main
Choose a base branch
from
fix/no-unknown-forks-gregor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
RangerMauve
requested changes
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, cleaner than before
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.
This is a rework of #1123, because during review I realised it was not necessary to maintain a separate table because we already store project info in the keys table.
This changes how leaving a project is tracked: it is now written to the project keys table before clearing project data. Previously we determined whether a project was left based on whether the project settings index had a row for it, which was based on several assumptions about what leaving a project did, assumptions which could break in the future (e.g. joining a project without encryption keys as a blind peer). This change required adding a new migration functionality to run JS code based on migration steps. It adds a bit of maintenance overhead, but it will also help the core manager store migration in #1092, and could be useful in the future.
A previous fix to ensure data is cleared after leaving a project used the change of role to acertain if the project had been left, however because this check was made every time a project instance was created, including when adding a new project from an invite, it was actually creating a big delay, because a project instance would not be returned until getOwnRole returned, which waited for initial sync.
This adds a
status
prop to themanager.listProjects()
function to be explicit about when a project is in the "joining" state, and adds an additional "left" status.There is a change of behaviour here where $getProjectSettings() will still return the basic project info (name, description, color, sendStats) even after leaving a project, which makes it consistent with what is returned from
listProjects()
.The test for "partly-left projects" should be more robust now too - it doesn't "pretend" to partly leave a project, but instead prematurely exits the process to more realistically simulate what would happen in real usage if leave project fails.
Also fixes a small type bug for the
projectInviteId
column of the projectKeysTable, which was defined asunknown
because it was defaulting to a JSON column I think.