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

fix: fix recreating invite link in case of expiration #9222

Merged
merged 4 commits into from
Jan 29, 2024

Conversation

igorlesnenko
Copy link
Contributor

fix #9062

I'm not exactly sure why #9062 happens.
We show dots if token is invalid, then we are fetching another token from the frontend.
I may suggest that on mobile with slow connection user may see dots for a while while we are fetching a new token.

However, this should rarely happen because if token is expired, we create new on the backend before returning it.

This mechanism was broken. I fixed it, which possibly fixes the whole issue

How to test:

  • Create a fresh team
  • Open invite dialog, copy invitation ID from the URL for example XSDBR1S0TF0X
  • Expire the url by running:
r.db('actionDevelopment')
  .table("MassInvitation")
 .get('XSDBR1S0TF0X')
 .update({
   expiration: new Date()
 })
  • Refresh page, open invite dialog again, see that a new invite URL appears and you didn't see dots while it was loading

@@ -85,7 +85,7 @@ const Team: GraphQLObjectType = new GraphQLObjectType<ITeam, GQLContext>({
.load(teamMemberId)
const [newestInvitationToken] = invitationTokens
// if the token is valid, return it
if (newestInvitationToken?.expiration ?? new Date(0) > new Date())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was always false

Copy link
Contributor

@Dschoordsch Dschoordsch left a comment

Choose a reason for hiding this comment

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

The change is fine, but does not solve the underlying problem. I could trigger the *** invite by:

  • open the "Invite to Team" dialog
  • stop the server
  • invalidate the token
  • start the server

The client reconnects but refreshes the token with ***

@igorlesnenko
Copy link
Contributor Author

@Dschoordsch not able to reproduce this, am I doing this right: https://www.loom.com/share/87e349a8d825420ebacabc5881d087ea ?

@Dschoordsch
Copy link
Contributor

Yes, the steps were correct, I think only the slow restart of the server messed it up: https://www.loom.com/share/428542d75b5d4be0aad2d544f9b8b0bd?sid=c859c58b-64f7-4029-878d-ba02dfc8a515

@igorlesnenko
Copy link
Contributor Author

Finally reproduced using offline mode in Network tab

Copy link
Contributor

@Dschoordsch Dschoordsch left a comment

Choose a reason for hiding this comment

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

Works!

@igorlesnenko igorlesnenko merged commit 027579e into master Jan 29, 2024
4 checks passed
@igorlesnenko igorlesnenko deleted the fix-inv-expiration branch January 29, 2024 16:39
@github-actions github-actions bot mentioned this pull request Jan 31, 2024
24 tasks
jordanh pushed a commit that referenced this pull request Feb 8, 2024
* fix: fix recreating invite link in case of expiration

* Fix token refetch
igorlesnenko added a commit that referenced this pull request Feb 12, 2024
* fix: add suggested vscode extensions (#9382)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* feat: add notifications for mention in reflections and show kudos preview (#9354)

* feat: add notifications for mention in reflections and show kudos preview

* Fix types

* chore(kudos): track kudos type and meeting type in kudosSent event (#9373)

* senderName senderPicture

* Fix tests

* Add TODO comment to use single Mentioned notification everywhere

* feat: add slack notification for mention and kudos in reflections (#9377)

* feat: add notifications for mention in reflections and show kudos preview

* Fix types

* feat: add slack notification for mention and kudos in reflections

* use const

* feat: support globs for org approvals (#9367)

* feat: refactor 4 sql queries to kysely

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* feat: refactor removeApprovalOD to kysely

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* feat: support wildcards in OrgApprovalDomains rules

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* support org approval for invites

Signed-off-by: Matt Krick <matt.krick@gmail.com>

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* feat: Release team insights (#9385)

Reverse the feature flag.

* feat: Allow retro meeting series naming (#9348)

* feat: Add meeting series end options for retros (#9370)

* feat: Add meeting series end options for retros

* Add update recurrence settings modals

* Stay on prettier major version 2

Don't reformat the whole codebase without reason.

* Run prettier :-/

* Sneak in change for new meeting series subscription

We were loading the new meeting with the activeMeetingsForTeamId
dataloader which was not invalidated after the meeting was modified with
the meeting series data.

* await had no effect

* fix: fix recreating invite link in case of expiration (#9222)

* fix: fix recreating invite link in case of expiration

* Fix token refetch

* fix: fix slack resonse replied anonymous notification (#9390)

* chore(release): release v7.15.0 (#9383)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix(env): typo in AZURE_DEVOPS vars (#9396)

* chore: update Ironbank GH action dependencies (#9393)

* Update ironbank GH actions

* update description

* chore(deps): bump nodemailer (#9399)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* fix: handle all types of errors in sendToSentry (#9387)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* fix: fix accepting invite always required email verification (#9404)

* chore(release): release v7.15.1 (#9397)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Igor Lesnenko <igor.lesnenko@gmail.com>
Co-authored-by: Georg Bremer <github@dschoordsch.de>
Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>
Co-authored-by: Rafa <101704572+rafaelromcar-parabol@users.noreply.github.com>
Co-authored-by: Dale Bumblis <135627447+dbumblis-parabol@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invite link on mobile sometimes displays ..... for invite link stub
3 participants