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(background): clear sessions on page reload #851

Merged
merged 6 commits into from
Jan 21, 2025

Conversation

sidvishnoi
Copy link
Member

@sidvishnoi sidvishnoi commented Jan 20, 2025

Context

Closes #850
Reopens #819
Part of #610

Changes proposed in this pull request

Revert #831, add tests for page reload, sessions & overpaying, mark tests that were fixed by #831 as failing.

@github-actions github-actions bot added the area: tests Improvements or additions to tests label Jan 20, 2025
Copy link
Contributor

github-actions bot commented Jan 20, 2025

Extension builds preview

Name Link
Latest commit 0084490
Latest job logs Run #12884147554
BadgeDownload
BadgeDownload

await page.evaluate(() => {
window.addEventListener('monetization', monetizationCallback);
await page.addInitScript({
content: `window.addEventListener('monetization', monetizationCallback)`,
Copy link
Member Author

Choose a reason for hiding this comment

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

addInitScript will be survive across page.reload and navigation (exposeFunction also survives such navigations), so we don't need to add listener again.

Copy link
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

test-e2e

@github-actions github-actions bot added the area: background Improvements or additions to extension background script label Jan 20, 2025
Copy link
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

test-e2e

Copy link
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

test-e2e

@sidvishnoi sidvishnoi changed the title fix(bg): avoid creating multiple outgoing payments on reload fix(bg): clear sessions on page reload Jan 20, 2025
@sidvishnoi sidvishnoi changed the title fix(bg): clear sessions on page reload fix(background): clear sessions on page reload Jan 20, 2025
@sidvishnoi sidvishnoi marked this pull request as ready for review January 21, 2025 08:02

const walletAddressUrl = process.env.TEST_WALLET_ADDRESS_URL;

test.describe('should not pay immediately when overpaying', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Spent the last couple of minutes looking for a test that goes through this flow without realizing that I already went through it. PEBCAK 🙄

@sidvishnoi sidvishnoi merged commit 9f68d39 into main Jan 21, 2025
9 checks passed
@sidvishnoi sidvishnoi deleted the revert-iframe-nav-bad-fixes branch January 21, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: background Improvements or additions to extension background script area: tests Improvements or additions to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sometimes multiple outgoing payments are created
2 participants