Open nichoth opened 6 months ago
I created a test that demonstrates my expectation:
https://github.com/nichoth/logux-client/blob/added/client/index.test.ts#L413
Strange.
if (exist) {
return false
} else {
let added = await promisify(store.os('log', 'write').add(entry))
delete store.adding[entry.created]
- meta.added = added
- return meta
+ return { ...meta, added }
}
}
I tried changing the file in client/indexed-store
as described — https://github.com/nichoth/logux-client/blob/added/indexed-store/index.js#L55 — but still the same test results. Also, on main branch in @logux/core
, the tests do not pass for me.
pnpm test
But, it looks like there is already a check for 'added' there — https://github.com/logux/core/blob/main/each-store-check/index.js#L132
I'm not sure where it is failing.
That test checks that store keep added
in storage. My theory that IndexedDB freeze object and add
just doesn't return the right object.
I will look on next week (too busy because of the conference on this week)
I am calling
client.log.add
in the browser code, and the returned metadata does not have theadded
field.Looking at the source code, we see that 'added' is added to
meta
. I'm not sure why I don't see it.