Update background script to sync user integration settings on login#311
Update background script to sync user integration settings on login#311bluant wants to merge 1 commit into
Conversation
|
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. 🙌 |
|
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. |
|
Hey, @milosfromcake. Yeah sorry I should've included them in the pr originally. Basically: Steps to reproduce:
3) Refresh the redmine app and everything works as expected, every ticket has clockify start timer on it. Great!
Then from whatever reason, chrome gets killed completely or pc gets restarted.
Side note - "Soft closing" chrome on macos keeps the timer shown correctly and you can close chrome as much times as you want and it'll always be shown. But restarting pc or killing chrome completely requires reapplying integrations. |


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
runtime.onStartupfor logged-in users:setIntegrationSettingsForCurrentUser()unregisterAllIntegrations()registerEnabledIntegrations()Expected Behavior
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.jsTesting
Commands run:
npm test- not available; this project currently has a placeholder test script that exits withError: no test specified.npm run compile.dev.chrome.nowatch- passed.npm run compile.dev.firefox.nowatch- passed.Manual validation that is still worth doing:
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.