Skip to content

Update background script to sync user integration settings on login#311

Open
bluant wants to merge 1 commit into
clockify:masterfrom
bluant:repoen-chrome-needs-domain-setup-again
Open

Update background script to sync user integration settings on login#311
bluant wants to merge 1 commit into
clockify:masterfrom
bluant:repoen-chrome-needs-domain-setup-again

Conversation

@bluant
Copy link
Copy Markdown

@bluant bluant commented Jun 1, 2026

Fix Integrations After Reopeining Browser

Summary

This is a small fix for integrations not being avaialble after the browser is closed and opened again. When the user is already logged in, we now run the existing integration setup during browser startup as well.

Context

The extension can still be logged in after restart, but the integration scripts are not always registred again. In that case supported pages can load without the Clockify integration UI until something else causes the setup flow to run.

What Changed

  • Added 3 lines inside runtime.onStartup for logged-in users:
    • setIntegrationSettingsForCurrentUser()
    • unregisterAllIntegrations()
    • registerEnabledIntegrations()

Expected Behavior

  • Enabled integrations should be available after a browser restart.
  • Existing enabled/disabled integration settings and custom URLs should still be used.
  • Existing login and logout behavior should remain the same.

User Impact

This should mostly be invisible to users. The main difference is that integrations should show up again after browser reopen, without users needing to refresh around or re-open the extension to get things working.

Files Changed

  • src/contentScripts/background.js

Testing

Commands run:

  • npm test - not available; this project currently has a placeholder test script that exits with Error: no test specified.
  • npm run compile.dev.chrome.nowatch - passed.
  • npm run compile.dev.firefox.nowatch - passed.

Manual validation that is still worth doing:

  • Log in and confirm enabled integrations are registered.
  • Restart the browser and confirm integrations are still active for the logged-in user.
  • Open a supported integration page after restart and confirm the Clockify integration UI appears.

Risk

Low. The change is only in the startup listener and reuses the same setup calls that already exist in the login/install path. A quick manul pass is still recommended because this depends on browser lifecycle behaviour.

@milosfromcake
Copy link
Copy Markdown
Contributor

Hello @bluant.

Thanks for your efforts to improve our project.

In the coming days, we will review and test your changes, after which we will inform you of the next steps.

All the best. 🙌

@milosfromcake
Copy link
Copy Markdown
Contributor

Hello, @bluant.

Can you provide us with the exact steps to reproduce the problem you solved with these changes?

Our QA team is currently unable to reproduce this issue.

Thanks in advance.

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