marsara9 / lemmy-search

An enhanced search engine just for Lemmy/Fediverse
https://www.search-lemmy.com
GNU Affero General Public License v3.0
81 stars 4 forks source link

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

Closed krestenlaust closed 1 year ago

krestenlaust commented 1 year ago

Describe the bug All URLs on this page are invalid: https://search-lemmy.com/results?query=denmark&preferred_instance=feddit.nl&page=1 picture

marsara9 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Fantastic!

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

marsara9 commented 1 year ago

@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 commented 1 year ago

Fixed with 0.3.3

marsara9 commented 1 year ago

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

krestenlaust commented 1 year ago

Sounds good!

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

marsara9 commented 1 year ago

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

krestenlaust commented 1 year ago

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 commented 1 year ago

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.

krestenlaust commented 1 year ago

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 commented 1 year ago

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

marsara9 commented 1 year ago

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

marsara9 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

krestenlaust commented 1 year ago

It's working🥳