powerhouse-inc / connect

https://document-model-electron.vercel.app
3 stars 3 forks source link

Update the way we fetch version mismatch #448

Open CallmeT-ty opened 1 month ago

CallmeT-ty commented 1 month ago

When we deploy switchboard & connect. Both usually get deployed with same doc mod libs & doc drive. But they have different versions on their own. We can define a minimum version, not the exact version.

  • [ ] Research needed to figure out if we can get the specific version in the lock file for the document drive server. (both on connect & switchboard side).
  • [ ] Add a version fingerprint hash to the response headers of switchboard.
  • [ ] update the version info endpoint to reflect the locked packaged versions instead of packed json version constraints
  • [ ] When connect encounters a new hash it should fetch the detailed version information from switchboard
  • [ ] If the switchboard version are more recent then the connect version it should prompt the user to refresh the browser.
  • [ ] Toast should be persistent and not be triggered multiple times, by passing arguments to make it persistent with an identifier to avoid duplicates.

Even if switchboard is updated with all of the latest dependencies Connect might still not be. Let's wait untill we have clarity around the mono repo before we pick up this issue.

DOD

  • Should be available on staging.

How do we test it?

  • Unit test for creating fingerprint hash from the detailed version info
  • Unit test for comparing version and the trigger condition
  • Manual test function through the browser console can get a read and set the connect version strings in order to trigger a fake version mismatch
  • Manual test should be documented in the comments + store file on notion with test instructions.

Originally posted by @CallmeT-ty in #341