-
Notifications
You must be signed in to change notification settings - Fork 4k
[Performance] Resolve destinationReportID before confirmation mount in global-create
#94459
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
Merged
mountiny
merged 12 commits into
Expensify:main
from
software-mansion-labs:korytko/fix-single-screen-reportid-regression
Jun 26, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
94e4e14
fix: set transaction reportID early in useResetIOUType for global-create
JakubKorytko f7f394c
fix: reset hasPreInsertFired on cleanup to allow re-fire on dependenc…
JakubKorytko d4357f0
test: add tests for early reportID resolution in useResetIOUType
JakubKorytko 692904c
refactor: extract resolveEarlyReportID as testable pure function
JakubKorytko 7340be7
refactor: move resolveEarlyReportID to IOUUtils
JakubKorytko 56a7467
Merge branch 'main' into korytko/fix-single-screen-reportid-regression
JakubKorytko 13dbc80
fix: self-dms, beta inbox
JakubKorytko 689d6ab
fix: stale pre-inserted flag
JakubKorytko 2f73292
guard splits
JakubKorytko cc96f1c
resolve earlyReportID earlier
JakubKorytko 1531882
fix: reportID fallback
JakubKorytko 90dd130
fix: self-dms on search
JakubKorytko 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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import {resolveEarlyReportID} from '@libs/IOUUtils'; | ||
| import CONST from '@src/CONST'; | ||
| import type {Participant} from '@src/types/onyx/IOU'; | ||
|
|
||
| describe('resolveEarlyReportID', () => { | ||
| it('returns workspace chat reportID for workspace participants', () => { | ||
| const participants: Participant[] = [{accountID: 0, reportID: 'workspace-chat-123', isPolicyExpenseChat: true, selected: true}]; | ||
|
|
||
| expect(resolveEarlyReportID(true, participants)).toBe('workspace-chat-123'); | ||
| }); | ||
|
|
||
| it('returns UNREPORTED_REPORT_ID for selfDM participants', () => { | ||
| const participants: Participant[] = [{accountID: 0, reportID: 'self-dm-456', isSelfDM: true, selected: true}]; | ||
|
|
||
| expect(resolveEarlyReportID(true, participants)).toBe(CONST.REPORT.UNREPORTED_REPORT_ID); | ||
| }); | ||
|
|
||
| it('returns undefined when not from global create', () => { | ||
| const participants: Participant[] = [{accountID: 0, reportID: 'some-report', selected: true}]; | ||
|
|
||
| expect(resolveEarlyReportID(false, participants)).toBeUndefined(); | ||
| }); | ||
|
|
||
| it('returns undefined when participants array is empty', () => { | ||
| expect(resolveEarlyReportID(true, [])).toBeUndefined(); | ||
| }); | ||
|
|
||
| it('returns undefined when participants is undefined', () => { | ||
| expect(resolveEarlyReportID(true, undefined)).toBeUndefined(); | ||
| }); | ||
|
|
||
| it('returns undefined when first participant has no reportID and is not selfDM', () => { | ||
| const participants: Participant[] = [{accountID: 123, selected: true}]; | ||
|
|
||
| expect(resolveEarlyReportID(true, participants)).toBeUndefined(); | ||
| }); | ||
|
|
||
| it('uses first participant only, ignores subsequent ones', () => { | ||
| const participants: Participant[] = [ | ||
| {accountID: 0, reportID: 'first-report', isPolicyExpenseChat: true, selected: true}, | ||
| {accountID: 0, reportID: 'second-report', isPolicyExpenseChat: true, selected: true}, | ||
| ]; | ||
|
|
||
| expect(resolveEarlyReportID(true, participants)).toBe('first-report'); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.