Skip to content

fix: inactive IDB tx in SenderTaggingStore#21918

Closed
mverzilli wants to merge 2 commits intomerge-train/fairiesfrom
martin/fix-idb-tx-timeout-v2
Closed

fix: inactive IDB tx in SenderTaggingStore#21918
mverzilli wants to merge 2 commits intomerge-train/fairiesfrom
martin/fix-idb-tx-timeout-v2

Conversation

@mverzilli
Copy link
Copy Markdown
Contributor

Fixes a subtle stale IDB tx issue we introduced in #20817.

Unfortunately this is tricky to reproduce in browser env, we do have kv-store tests that run on playwright but nothing similar for PXE's actual stores. For now it's important for this fix to be quickly added, I'll try to play with adding some playwright regression test in the next days.

@mverzilli mverzilli requested review from Thunkar and benesjan March 23, 2026 20:55
@mverzilli mverzilli enabled auto-merge (squash) March 23, 2026 20:57
Copy link
Copy Markdown
Contributor

@Thunkar Thunkar left a comment

Choose a reason for hiding this comment

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

IDB is cursed, thanks for this

@benesjan
Copy link
Copy Markdown
Contributor

benesjan commented Mar 24, 2026

I broke a thing again 😭😭😭😭

@benesjan benesjan disabled auto-merge March 24, 2026 05:39
Copy link
Copy Markdown
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

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

Did not approve yet as I don't fully understand the bug.

Once I'll grok it will be happy to approve.

Thanks for cleaning my mess!

// Read and process within a single transactionAsync so the IDB transaction stays alive across
// the read → process → staged-write sequence. Before this fix, #getSecretsWithPendingData opened
// and closed its own transaction, then the writes happened outside any transaction — allowing the
// browser to auto-commit the IDB transaction between the two phases.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still don't follow why exactly was this an issue when the staged write doesn't write into the db (it just stores the info in memory).

So why do we need to keep the tx alive given that the write is not a db write?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, you're right. I scrambled to open this PR because it was late and I was hoping to get it into a nightly if CI was green, but I've been testing more this morning and I can still reproduce the issue

continue;
}
// Read and process within a single transactionAsync so the IDB transaction stays alive across
// the read → process → staged-write sequence. Before this fix, #getSecretsWithPendingData opened
Copy link
Copy Markdown
Contributor

@benesjan benesjan Mar 24, 2026

Choose a reason for hiding this comment

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

Before this fix, #getSecretsWithPendingData opened...

Ideally comments should not assume knowledge of history of the codebase so would not mention "before this fix" here.

That part of comment most likely should have been just a github comment.

@mverzilli
Copy link
Copy Markdown
Contributor Author

I broke a thing again 😭😭😭😭

It's not even clear that you did anymore. I've reproduced something that look like the bug with the patch applied earlier today. Now I rolled it back and I can't reproduce. So it's a really annoying one

@mverzilli
Copy link
Copy Markdown
Contributor Author

Closing as @Thunkar traced the issue to an "illegal" direct usage of PXE from the user app. Sorry @benesjan for the false alarm 😭

@mverzilli mverzilli closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants