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

Invalid URLs in search result ('nullpost') #21

Closed
krestenlaust opened this issue Jul 4, 2023 · 18 comments · Fixed by #27
Closed

Invalid URLs in search result ('nullpost') #21

krestenlaust opened this issue Jul 4, 2023 · 18 comments · Fixed by #27
Assignees
Labels
bug Something isn't working critical Needs work as soon as possible

Comments

@marsara9
Copy link
Owner

marsara9 commented Jul 4, 2023

Thanks. I've seen this one before. I figured it was from my test environment.

As a workaround change your preferred instance and then back again and it should work.

My current guess is that I've got a race condition between the call to /search and /instances.

@marsara9 marsara9 added bug Something isn't working critical Needs work as soon as possible labels Jul 4, 2023
@marsara9 marsara9 self-assigned this Jul 4, 2023
@marsara9 marsara9 modified the milestone: In Progress Jul 4, 2023
@marsara9
Copy link
Owner

marsara9 commented Jul 4, 2023

I should have a fix for this in the next day or so. Found and plugged the race-condition. Just trying to bundle up a few more defects before kicking off a build.

@krestenlaust
Copy link
Author

krestenlaust commented Jul 4, 2023

Fantastic!

Edit: I'll keep the issue open till the release

marsara9 added a commit that referenced this issue Jul 4, 2023
search query isn't sent to the server now until AFTER the list of instances is returned.
@marsara9
Copy link
Owner

marsara9 commented Jul 4, 2023

@krestenlaust pushing a build to the dev docker tag. I don't know if you're running a local instance or not, but you are you can see many of the changes I'm working on there once this is done: https://github.com/marsara9/lemmy-search/actions/runs/5458573933

If not, I'll be pushing this out sometime in the next 24hrs.

@marsara9 marsara9 closed this as completed Jul 5, 2023
@marsara9
Copy link
Owner

marsara9 commented Jul 5, 2023

Fixed with 0.3.3

@marsara9 marsara9 reopened this Jul 5, 2023
@marsara9
Copy link
Owner

marsara9 commented Jul 5, 2023

The issue still exists. But I think I've got it narrowed down. Should have it fixed in 0.3.4 tomorrow.

@krestenlaust
Copy link
Author

Sounds good!

I still just using the official instance, might try to set up docker some time later.

marsara9 added a commit that referenced this issue Jul 5, 2023
@marsara9
Copy link
Owner

marsara9 commented Jul 6, 2023

This should finally be fixed. If not, please reopen the issue.

@marsara9 marsara9 closed this as completed Jul 6, 2023
@krestenlaust
Copy link
Author

Has the fix been released to search-lemmy.com yet?

I'm still experiencing the issue: https://search-lemmy.com/results?query=denmark&home_instance=geddit.social&page=1

I can upload the source of the webpage if you'd like.

@marsara9
Copy link
Owner

marsara9 commented Jul 6, 2023

Ugh. Tapping your link does reproduce the issue consistently but doing the search manually, I can't. ...I hate race conditions. And sadly this will only be reproducible in production. You'll never be able to reproduce this if you create your own instance unless you have the same data.

I think I'm going to see if fixing issue #17 might have any effect on this. But for now if you use any of the larger instances it does not seem to happen as much.

@marsara9 marsara9 reopened this Jul 6, 2023
@krestenlaust
Copy link
Author

Is it possible for you to reproduce the race condition on a local instance using a network utility like Clumsy? You can throttle/delay specific ports.

@krestenlaust
Copy link
Author

But yes, race conditions are the worst. Incredibly unpredictable usually, and hard to reproduce in test environments

@marsara9
Copy link
Owner

marsara9 commented Jul 6, 2023

Wait, can you try clearing your browser cache and trying again?

@marsara9
Copy link
Owner

marsara9 commented Jul 6, 2023

But playing around some more I do think that removing the home-instance parameter from the URL is going to be my best bet on this one.

@krestenlaust
Copy link
Author

Wait, can you try clearing your browser cache and trying again?

I'm afraid there's no difference either. I just tried using incognito in Chrome (I haven't opened this site before on that browser)

@marsara9
Copy link
Owner

marsara9 commented Jul 6, 2023

Ok. Tomorrow/this weekend, I'm going to try removing the home-instance parameter altogether.

The problem I keep running into is that the home-instance isn't matching what's in my cookie and the system appears to get confused.

But ya I'll be a day or so before the next version to test against.

marsara9 added a commit that referenced this issue Jul 6, 2023
…nstance as a query parameter. The value is read directly from the user's cookie and then passed to the /search endpoint.

This should make it easier to share search URLs and hopefully fix the nullpost bug.
@marsara9 marsara9 linked a pull request Jul 6, 2023 that will close this issue
@marsara9
Copy link
Owner

marsara9 commented Jul 7, 2023

Pushing a new build to prod soon. This should resolve the nullpost issue for good. fingers crossed

@marsara9 marsara9 closed this as completed Jul 7, 2023
@krestenlaust
Copy link
Author

It's working🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical Needs work as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants