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

Update imbl dependency to fix their bug in Focus::narrow() #71

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

kevinaboos
Copy link
Contributor

Update the imbl dependency to include this recent fix specifically: jneem/imbl#89

This is causing bugs in the matrix-rust-sdk and in downstream clients, e.g., project-robius/robrix#332

Once this is merged in, I will similarly patch the matrix-rust-sdk such that clients can leverage the fix too.

This is causing bugs in the matrix-rust-sdk and in downstream clients.
@jplatte
Copy link
Owner

jplatte commented Jan 20, 2025

I'm happy merging an upgrade to imbl 4.0, but the patch doesn't make sense as it only affects cargo commands run inside this repo, not any uses of eyeball-im as a dependency. Or was the bug that you linked a fix of only introduced in 4.0 such that tests would fail with the upgrade alone?

@kevinaboos
Copy link
Contributor Author

I'm happy merging an upgrade to imbl 4.0, but the patch doesn't make sense as it only affects cargo commands run inside this repo, not any uses of eyeball-im as a dependency. Or was the bug that you linked a fix of only introduced in 4.0 such that tests would fail with the upgrade alone?

That's correct, the patch is listed here for the sake of (1) consistency and clarity of intent, and (2) allowing direct cargo builds of this repo alone to succeed.

The real key change is upgrading the eyeball workspace to depend on v4.0.0 of imbl, such that patches both here and in other downstream users of this crate will actually take effect. If we leave it at v3.0.0, cargo will not select the latest commit specified in the patch override.

For example, I also intend to update matrix-rust-sdk to depend on v4.0.0 of imbl which can then be patched with the same patch statement included here. Users of matrix-rust-sdk (such as our own client implementation) can then also utilize that same patch.

Alternatively, if you don't like the patch override approach, that's fine -- we can just directly write the dependency as a git dependency instead of a crates.io version dependency. That's just a little bit less canonical, but it may actually be preferable here since this crate is typically a deeply-nested transitive dependency.

@Hywan
Copy link
Collaborator

Hywan commented Jan 21, 2025

@kevinaboos Out of curiosity, can you point at a bug in the SDK caused by the bug in imbl?

@jplatte
Copy link
Owner

jplatte commented Jan 21, 2025

Honestly, let's just ask the maintainer of imbl to do a patch release before merging this? That seems a lot easier 😅

@kevinaboos
Copy link
Contributor Author

@kevinaboos Out of curiosity, can you point at a bug in the SDK caused by the bug in imbl?

not directly within the SDK, but easily reproducible for immediate downstream users of the SDK: project-robius/robrix#330

Basically the problem is that the bounds check is wrong on Focus::narrow(). So, for example, if you are searching through the Vector of timeline items, narrowing the Focus with a completely valid Range that includes the last item in the timeline Vector will fail with a full panic.

@kevinaboos
Copy link
Contributor Author

kevinaboos commented Jan 21, 2025

Honestly, let's just ask the maintainer of imbl to do a patch release before merging this? That seems a lot easier 😅

Haha, totally fair!

EDIT: just asked them as you recommended. I agree that's a better approach than multiple rounds of patch overrides.

@Hywan
Copy link
Collaborator

Hywan commented Jan 22, 2025

jneem/imbl#91 (comment) 0.4.1 is available. Are you willing to update eyeball @kevinaboos since you've initiated the idea. If you don't have time, I'll take care of it.

@kevinaboos
Copy link
Contributor Author

jneem/imbl#91 (comment) 0.4.1 is available. Are you willing to update eyeball @kevinaboos since you've initiated the idea. If you don't have time, I'll take care of it.

Sure, happy to do it. Will submit PRs tomorrow!

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@jplatte
Copy link
Owner

jplatte commented Jan 23, 2025

There, now you just need to accept my suggestions and I can squash-merge the result ^^

@jplatte jplatte changed the title Update and patch imbl dep to fix their bug in Focus::narrow() Update imbl dependency to fix their bug in Focus::narrow() Jan 23, 2025
@kevinaboos
Copy link
Contributor Author

kevinaboos commented Jan 24, 2025

There, now you just need to accept my suggestions and I can squash-merge the result ^^

Thanks! Apologies for the delay, swamped lately.

@jplatte jplatte merged commit b252748 into jplatte:main Jan 24, 2025
6 checks passed
@kevinaboos
Copy link
Contributor Author

Nice. If y'all plan to publish a new release to crates.io soon, I can wait on that before PR-ing the matrix-rust-sdk. If you intend to wait a while, I can submit a patch-based PR to point to this latest git commit.

@jplatte
Copy link
Owner

jplatte commented Jan 24, 2025

Going to release soon.

@jplatte
Copy link
Owner

jplatte commented Jan 24, 2025

eyeball-im 0.6.0 and eyeball-im-util 0.8.0 are out!

@kevinaboos kevinaboos deleted the patch_imbl_focus_narrow_bug branch January 24, 2025 23:56
@kevinaboos
Copy link
Contributor Author

kevinaboos commented Jan 25, 2025

PR submitted to matrix-rust-sdk. Thanks again for your quick replies!

matrix-org/matrix-rust-sdk#4583

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