Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

fix(rpc): setup swarm connection on next tick to fix a bug with dht-relay #92

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Nuhvi
Copy link
Collaborator

@Nuhvi Nuhvi commented Jun 15, 2023

No description provided.

@Nuhvi Nuhvi requested review from rbndg and dzdidi June 15, 2023 13:47
Copy link
Contributor

@dzdidi dzdidi left a comment

Choose a reason for hiding this comment

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

Why timeout instead of nextTick, what is the reason for skipping tests?
Any ideas what caused changes in package-lock?

this._swarm.on('connection', (connection) => {
// Setup a new RPC instance on every connection
// waiting for next tick fixes an obscure bug when using @hyperswarm/dht-relay
setTimeout(() => this.setup(connection), 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use process.nextTick() instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

browser support

@dzdidi
Copy link
Contributor

dzdidi commented Jun 16, 2023

what about skipped tests and lock file change?

@Nuhvi
Copy link
Collaborator Author

Nuhvi commented Jun 16, 2023

what about skipped tests and lock file change?

It is important to note that lock file doesn't get published on NPM, it is merely for development purposes. I often delete it and reinstall everything, just to make sure I am developing on latest versions of everything. Maybe we should remove it.

Skipped tests are mostly dealing with deprecated API (stuff that doesn't use core-data module) and are breaking now mostly because they were using Drivestore and that was using an earlier version of Corestore. I can update Drivestore to work with new versions of Corestore, but I was hoping to finish migration to core-data soon and skip support for Drivestore.

@dzdidi
Copy link
Contributor

dzdidi commented Jun 16, 2023

It is important to note that lock file doesn't get published on NPM, it is merely for development purposes.

for publishing there is a shrinkwrap

I often delete it and reinstall everything, just to make sure I am developing on latest versions of everything.

Haven't you had a problem because of it recently?

@dzdidi
Copy link
Contributor

dzdidi commented Jun 16, 2023

Skipped tests are mostly dealing with deprecated API (stuff that doesn't use core-data module) and are breaking now mostly because they were using Drivestore and that was using an earlier version of Corestore. I can update Drivestore to work with new versions of Corestore, but I was hoping to finish migration to core-data soon and skip support for Drivestore.

Does it mean that they can be safely removed?

@Nuhvi
Copy link
Collaborator Author

Nuhvi commented Jun 16, 2023

Does it mean that they can be safely removed?

No, any code that is still using Drivestore, but updates Corestore will get errors. Luckily for now Bitkit is the main user, and lockfiles are helping there.

After opening this issue (and delivering this fix manually in my local attempt to move core-data api to Bitkit) other issues appeared in Bitkit anyways, so there is a chance we will have to wait for bare.js, because bugs in corestore and hyperswarm seem endless in Bitkit right now, while in nodejs everything is much more robust.

Up to @rbndg, maybe we can close these two PRs and wait for bare.

@Nuhvi
Copy link
Collaborator Author

Nuhvi commented Jun 16, 2023

To make that a bit more clear: If you want to break compatibility (maybe deliver a major version of Slashtags) then yes we can safely remove Drivestore and everything related to it, it just needs to be a major version.

Let me take 30 minutes to see if I can update drivestore to use CoreData as a temporary fix!

@Nuhvi
Copy link
Collaborator Author

Nuhvi commented Jun 16, 2023

Added in separate PR to make it easier to review #94

@Nuhvi
Copy link
Collaborator Author

Nuhvi commented Jul 3, 2023

Updated after merging #94, it doesn't solve https://github.com/synonymdev/slashtags-core-data/pull/19 so not sure if it is worth merging now. Maybe after solving that it wouldn't be needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants