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

chore: invite API's membership check can be synchronous #480

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

EvanHahn
Copy link
Contributor

This change should have no user impact.

This function doesn't do anything async so we can make it synchronous. I think this is a useful change on its own but will make upcoming changes (#447) a bit simpler.

This change should have no user impact.

This function doesn't do anything async so we can make it synchronous.
I think this is a useful change on its own but will make upcoming
changes a bit simpler.
@gmaclennan
Copy link
Member

There is one thing missing from the existing implementation that is asynchronous: project membership also has a "joining" state, eg a user has accepted an invite but has not finished adding the project, eg if they do not receive back the project join details, or the add project method fails for some reason. Ideally other invites would await the joining state rather than treat it as an "already joined" state. I think it's ok to ignore that state for now, but making this asynchronous just leaves more work when we try to add it back. I'm ok with that as long as we don't get ourselves into a corner where we make it really hard to deal with this edge case in the future.

@EvanHahn
Copy link
Contributor Author

Good point. I'll make sure to do that in my upcoming work (#447).

In any case, I still think it makes sense for this to be synchronous because I don't think the "joining" state would be stored here.

Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, looks good.

@EvanHahn EvanHahn merged commit 964cb80 into main Feb 25, 2024
7 checks passed
@EvanHahn EvanHahn deleted the isMember-can-be-synchronous branch February 25, 2024 22:30
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