tim-smart / tim-smart/receipts

can't get sync server to work

Open
#2 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
43
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Also I don't understand how this would work, we have the remoteAtom like this:

export const remoteAtom = Atom.runtime((get) =>
  Effect.gen(function* () {
    const identity = yield* get.some(identityAtom)
    const remoteAddress = yield* get.some(remoteAddressAtom)
    const url = new URL(remoteAddress)
    url.searchParams.set("publicKey", identity.publicKey)
    return EventLogRemote.layerWebSocketBrowser(url.toString()).pipe(
      Layer.provide(get(eventLogAtom.layer)),
    )
  }).pipe(Layer.unwrapEffect),
)

But the runtime inside remoteAtom isn't used anywhere as far as I can tell?

Im running the sync server like

docker run -d -p 3000:3000 -v /Users/dev/data:/data timsmart/effect-eventlog-sqlite

And I tried setting remote URL to ws://localhost:3000 and http://localhost:3000 and neither worked.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing usages of remoteAtom and the EventLogRemote.layerWebSocketBrowser call in the TypeScript code. Reproduce the setup with the documented docker run command and test the configured ws://localhost:3000 and http://localhost:3000 URLs. Done means the sync server connects and synchronization works, with the runtime usage or required configuration clarified.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.