logux / logux/client

`IndexedStore` — `meta.added` property

Open
#107 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
747
Forks
49
PR merge metrics
No merged PRs in 30d

Description

I am calling client.log.add in the browser code, and the returned metadata does not have the added field.

const client = new CrossTabClient({
    server: (import.meta.env.DEV ?
        'ws://localhost:8765' :
        'wss://logux.example.com'),
    store: new IndexedStore('try-logux'),
    subprotocol: '1.0.0',
    userId: 'anonymous',  // TODO: We will fill it, in Authentication recipe
    token: '123'  // TODO: We will fill it in Authentication recipe
})

// ...

const inc = increment()
const meta = await client.log.add(inc, { sync: true })  // should add `added` here
debug('the increment meta', meta) // <-- does not have 'added' prop

Looking at the source code, we see that 'added' is added to meta. I'm not sure why I don't see it.

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 with indexed-store/index.js around line 55 and trace the shown client.log.add call using IndexedStore. Confirm why the returned metadata lacks added and verify the reproduction once the behavior is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.