Repository navigation
fix: Group is created with duplicate #51712
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
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e7aedd9
fix: Group is created with duplicate
nkdengineer c3debc9
Merge branch 'main' into fix/49931
nkdengineer eda06bd
fix the flicker bug
nkdengineer fb2870c
fix lint
nkdengineer 5793bed
Merge branch 'main' into fix/49931
nkdengineer 45c7e48
revert the previous change
nkdengineer c50f2f9
Merge branch 'main' into fix/49931
nkdengineer 9aaa383
Merge branch 'main' into fix/49931
nkdengineer cd016e6
Merge branch 'main' into fix/49931
nkdengineer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
@danieldoglas @tgolen can I have your opinion on this change please. I think you may know more about the possible implications of changing this behaviour in the queue.
You may want to look at here too: #51712 (comment)
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.
hmm. I'm not 100% sure.
Considering that GetMissingOnyxUpdates is not added to the sequential queue, this might call the flush method while GetMissingOnyxUpdates is being executed.
@chrispader what do you think?
Uh oh!
There was an error while loading. Please reload this page.
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.
In case it is of interest... another way of fixing the problem we are trying to fix here would be to stop forwarding the
CreateReportActioncommand here: https://github.com/Expensify/Auth/blob/de9f50789e666b56e0bee0e1658b8fa67a35c742/auth/lib/Report.cpp#L7797-L7805 and do it without command forwarding. The command forwarding is causing theOpenReportto not return the correctlastUpdateID. The command forwarding was done to allowOpenReportto finish faster (optimization).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.
I think it's definitely not idea to make
OpenReportslower... but it also definitely sounds like a backend bug and the frontend fix is only a bandaid over it. I especially am concerned that the sequential queue is being changed to try and work around this.I don't know if this is even possible, or what it would do... but what would happen if we changed
OpenReportto not returnlastUpdateIDat all? I think that would be better than returning an incorrect one.Uh oh!
There was an error while loading. Please reload this page.
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.
The deferred update logic in
OnyxUpdateManageris always only triggered after theSequentialQueuehas been paused.Calling
flushOnyxUpdatesQueue()while theSequentialQueueis still paused will result in nothing except for a log.App/src/libs/Network/SequentialQueue.ts
Lines 51 to 54 in 45c7e48
Therefore i don't think the deferred update logic in
OnyxUpdateManagerwould be affected. Though, this means that theQueuedOnyxUpdateswon't actually get flushed if there is aGetMissingOnyxUpdatescheck currently runningSince we don't introduce an extra
SequentialQueue.unpause()call in this PR, i don't see a technical problem about this change.but ... ⬇️
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.
bump @aldo-expensify
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.
Looks like Aldo is OOO until Monday. I think this is OK to wait to hear back from him.
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.
This optimization was introduced here https://github.com/Expensify/Auth/pull/8595/files for the command CreateChatReport, so it seems like affecting
OpenReportwas not the intention.From the conversations in the issue, it looks like the slow part of creating a new chat is checking if the "participants know each other" in this query: https://github.com/Expensify/Auth/blob/01acb32728415564d4ef0321934433bde38c1462/auth/lib/Account.cpp#L4465-L4484
Removing the command forwarding may help with @DylanDylann 's case here since this code is reused by more than one command and it may be root cause of that issue too.
Maybe one thing we can try is: calculate the
Account::isAccountKnownToCurrentUserinprePeek(it is the expensive part we want to avoid inprocess) and revert the command forwarding.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.
I'll start working on a backend PR and assess how feasible this is.
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.
Started to work on this here: https://github.com/Expensify/Auth/pull/13168