CyCraft / CyCraft/magnetar

test(core): add test for doc removed during stream directly after edit

Open
#59 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
46
Forks
6
PR merge metrics
No merged PRs in 30d

Description

write a test that tests this part:

https://github.com/cycraft/magnetar/blob/9d7eb1efb2fb350e9cfa899adf7be8f4ff6ed3fd/packages/core/src/moduleActions/handleStreamPerStore.ts#L112-L118

steps:
1. open stream for a doc
1. edit a doc locally (core goes into 5 sec writeLock)
2. that doc is deleted from the server side during these 5 seconds
3. the doc gets and stays deleted from local module data after the 5 seconds

potential bug without the highlighted lines (hypothesis):
- it will delete the doc locally _during_ the 5 seconds and is then brought back to life _after_ the 5 seconds write lock

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading packages/core/src/moduleActions/handleStreamPerStore.ts at lines 112-118 and locate the existing core stream tests. Reproduce the five-second write-lock sequence: edit locally, remove the document remotely, then verify the document remains absent from local module data after the lock expires.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
databases, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.