Skip to content

Conversation

@islathehut
Copy link
Collaborator

No description provided.

@islathehut
Copy link
Collaborator Author

islathehut commented Feb 14, 2025

Quiet Issue

@islathehut islathehut force-pushed the feat/error-handling-improvements branch from 89860d2 to e5ca22a Compare May 16, 2025 19:41
@islathehut islathehut requested a review from adrastaea May 19, 2025 13:11
Copy link
Collaborator

@adrastaea adrastaea left a comment

Choose a reason for hiding this comment

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

These changes cause a number of tests in the repo to fail which means that we're likely breaking some fundamental assumptions that OrbitDB is making. When I reverted the changes to sync.js, those failures largely resolved.

meta = meta || {}
referencesCount = Number(referencesCount) > -1 ? referencesCount : defaultReferencesCount

events = events || new EventEmitter()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we care about passing in our own event emitter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was just so we could share event emitters between different elements (e.g. storage and database instance).

}
return value

return undefined
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm concerned that this changes the expected behavior of the function by not re-emitting the error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah so like if an update error occurs we wouldn't emit the get error?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, suppose that the sync protocol depends on the error being emitted when a block can't be gotten to abort the stream, but we suppress the error and then the stream continues erroneously. On the other hand, what you did here seems to match the behavior in the included level.js, so I'm going to approve.

@islathehut
Copy link
Collaborator Author

These changes cause a number of tests in the repo to fail which means that we're likely breaking some fundamental assumptions that OrbitDB is making. When I reverted the changes to sync.js, those failures largely resolved.

Turns out I accidentally moved a piece of code into a for loop. I think it worked fine in practice because we were always executing that for loop but in tests we weren't. Moving it back out of the loop fixed all of the tests.

@islathehut
Copy link
Collaborator Author

I made some changes to tests to push all of the test data (with the exception of tests that specifically use all default parameters) into the test directory so cancelling tests or bad cleanup won't leave a bunch of junk in git.

I'm not sure why the linter is complaining because the comma its referencing doesn't exist 🤷‍♀️

@islathehut islathehut changed the title feat(2708): Error handling improvements feat(2807: Error handling improvements Jun 11, 2025
@islathehut islathehut changed the title feat(2807: Error handling improvements feat(2883): Error handling improvements Jun 11, 2025
@adrastaea adrastaea self-requested a review June 12, 2025 20:57
@islathehut islathehut merged commit dad5fe7 into main Jun 13, 2025
10 checks passed
@islathehut islathehut deleted the feat/error-handling-improvements branch June 13, 2025 13:57
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.

3 participants