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

Add rollback to postProcess #2081

Closed
wants to merge 1 commit into from
Closed

Add rollback to postProcess #2081

wants to merge 1 commit into from

Conversation

aldo-expensify
Copy link
Contributor

@aldo-expensify aldo-expensify commented Jan 30, 2025

Details

Context: https://expensify.slack.com/archives/C05CBC62HGW/p1738208970608929?thread_ts=1738090282.125069&cid=C05CBC62HGW

It seems like postProcessCommand doesn't clear the db's query cache at the end, so it is possible that subsequent command's prePeek may read stale data from this cache. This can only happen for a subsequent command's prePeek and not peek because peek clears the cache when it opens a new transaction.

I'm not sure if this can happen in production, I was only able to confirm it running tests.

Fixed Issues

Fixes flakey tests mentioned here: https://github.com/Expensify/Auth/pull/13089#discussion_r1934500303

Tests

You have to run ShareReportsWithAdminOrAuditorTest a lot of times while having checked out this PR: https://github.com/Expensify/Auth/pull/13089

I ran the test 400 times without failure (before this fix, I got 8 failures in 200 runs)


Internal Testing Reminder: when changing bedrock, please compile auth against your new changes

@aldo-expensify aldo-expensify self-assigned this Jan 30, 2025
@aldo-expensify
Copy link
Contributor Author

aldo-expensify commented Jan 30, 2025

@tylerkaraszewski does this fix make sense to you? 🙇

@aldo-expensify aldo-expensify requested review from tylerkaraszewski and a team January 30, 2025 20:05
@melvin-bot melvin-bot bot requested review from deetergp and removed request for a team January 30, 2025 20:05
@tylerkaraszewski
Copy link
Contributor

I already fixed this here: #2067 which I think is a more general solution than this one but it hasn't been merged.

@aldo-expensify
Copy link
Contributor Author

Closing this PR because I confirmed that Tyler's fix #2067 is also fixing the bug (I ran the test 1000 times and they didn't fail)

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.

3 participants