Outdated resource gap - how to make sure the front-end always shows latest version
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 82
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 205
Description
In the CI, some E2E tests were failing - all of them related to websockets. The second window was showing outdated resources.
Cause (unverified)
- A commit is processed for a new Resource A
- Resource A is opened in a new window
- Resource A is included in the HTML of the page by the server
- A commit is processed for Resource A'
- When the page is rendered and the JS has executed, a
SUBSCRIBEmessage is sent to the server - The client does not receive the A' commit, and only knows resource A.
Possible fixes
Include last-commit in SUBSCRIBE calls
- Client (optionally) includes the
last-commitinSUBSCRIBEmessage - Server checks if this is indeed the latest commit for that resource
- If false, the server sends an
RESOURCEmessage to the client with the latest version.
Add a timeout in the E2E tests
- Quick 'n Dirty fix, doesn't address the underlying problem
Combine GET and SUBSCRIBE messages
- Instead of doing a
GETand a subsequentSUBSCRIBE, just do aSUBSCRIBEand that returns the full Resource
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the websocket-related E2E failures and trace the GET, SUBSCRIBE, and RESOURCE message flow between the front end and server. Compare the client’s resource version with the server’s latest commit, then determine which proposed approach has clear tests proving that a newly opened window displays the latest resource.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, frontend, testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100