Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstrate issue #3319 #3322

Closed
wants to merge 1 commit into from
Closed

Demonstrate issue #3319 #3322

wants to merge 1 commit into from

Conversation

ofekd
Copy link

@ofekd ofekd commented Aug 10, 2021

Please see issue #3319

@pubkey
Copy link
Owner

pubkey commented Sep 27, 2021

I think this is solved in the latest version.
Can you rebase from master branch?

@ofekd
Copy link
Author

ofekd commented Sep 27, 2021

@pubkey done, getLastPullDocument isn't resolving instead of returning null

@pubkey
Copy link
Owner

pubkey commented Oct 4, 2021

Is this solved in the latest release?

@pubkey pubkey closed this Oct 12, 2021
@ofekd
Copy link
Author

ofekd commented Dec 2, 2021

@pubkey apologies, I was unavailable. getLastPullDocument still isn't resolving for pouch. For loki (amazing addition, I will be migrating), it errors out:


  1) replication-graphql.test.js
       node and browser
         crawling-checkpoint
           .getLastPullDocument()
             should delete the doc after db.remove():
     Error: BroadcastChannel.postMessage(): Cannot post message after channel has closed
      at BroadcastChannel.postMessage (node_modules/broadcast-channel/dist/es5node/broadcast-channel.js:107:13)
      at RxStorageKeyObjectInstanceLoki._callee3$ (src/plugins/lokijs/rx-storage-key-object-instance-loki.ts:188:26)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22)
      at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
      at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
      at /home/ofek/rxdb/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
      at new Promise (<anonymous>)
      at RxStorageKeyObjectInstanceLoki.<anonymous> (node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
      at RxStorageKeyObjectInstanceLoki.requestRemoteInstance (dist/lib/plugins/lokijs/rx-storage-key-object-instance-loki.js:255:37)
      at RxStorageKeyObjectInstanceLoki._callee5$ (src/plugins/lokijs/rx-storage-key-object-instance-loki.ts:325:25)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22)
      at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
      at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

I have pushed a rebased version

@pubkey pubkey reopened this Dec 2, 2021
@pubkey
Copy link
Owner

pubkey commented Dec 2, 2021

There is a similar error when running the current tests many times: https://github.com/pubkey/rxdb/runs/4384515025?check_suite_focus=true
So this is very likely a RxDB bug

@ofekd
Copy link
Author

ofekd commented Dec 3, 2021

It looks like in this specific test it happens because db.remove() closes broadcastChannel, and then it can't be used for getLastPullDocument. There's probably something similar happening in the pouch case

(docData as any).name = 'foobar';

await setLastPullDocument(c, endpointHash, docData);
await c.database.remove();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait. So you remove the database and then query it again? I am not sure if this is supposed to work.

Copy link
Author

@ofekd ofekd Dec 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally that was to show the local documents persist DB removal. Now that they are removed, the question is only if getLastPullDocument should fail or return null

Not sure why other loki test error, though

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running any operation on a removed collection/database should fail.
To query it again, a new RxDatabase must be created.

@pubkey
Copy link
Owner

pubkey commented Dec 11, 2021

Running any operation on a removed collection should fail

@pubkey pubkey closed this Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants