PhiTux / DailyTxT

Encrypted Diary Web-App
https://hub.docker.com/r/phitux/dailytxt/
MIT License
223 stars 15 forks source link

error on search #9

Closed eatingcakeagain closed 2 years ago

eatingcakeagain commented 2 years ago

hello,

I have recently installed this docker image and entered ~30 entries. I wanted to test the search function with a word I know I entered, but I get the following error pop up in the lower right corner of the page... any support would be appreciated as I currently like the look and feel of this container and would like to use it more.

LINK: https://i.imgur.com/9vVZ85y.png

chrome_3tLNccbfJg

"Invalid token. Registration and / or authentication required"

many thanks

PhiTux commented 2 years ago

Hi,

thanks for the message! This should obviously not happen. Normally this message should only appear, when you are actually signed out and the authentication failed...

  1. Is the rest of the program still working normally? Can you save new text or select another day? -> So, are you sure, you're signed in?
  2. Does this error only appear on a specific searchword, or is the search not working at all?
PhiTux commented 2 years ago

And perhaps 3.: Could you give some example to rebuild this problem?

eatingcakeagain commented 2 years ago

Hi - thanks for getting back to me so quickly. to answer your 3 comments/questions:

  1. Is the rest of the program still working normally? Can you save new text or select another day? -> So, are you sure, you're signed in? ------> As far as I can tell the rest is working properly; I have been able to export/backup the data as a zip, then recreated the container and imported it fresh again - this all still came with the same error though (sadly). Definitely signed in and able to create new items on various days.

  2. Does this error only appear on a specific searchword, or is the search not working at all? ------> I have tried with a handful of words that I have put in to the system and they all come up with the error.

  3. Could you give some example to rebuild this problem? ------> I am running this on an unraid system, downloaded the container from there... the odd thing was that it seemed to work one time after inputting 2 or 3 items in for last week , but have since added ~30 and since then the error comes up in the search - sorry there is no other way I can think of to recreate or rebuild the problem - unless I have installed incorrectly, but I took the "standard" settings to create the container.

PhiTux commented 2 years ago

Okay, that's really strange...

Just to be sure: Let's say you select today (02/21/2022) and there is the following text inside: "Today is a great day, because I am eating cake again."

This text is saved (green border) and visible even after switching back/forth one day and now you search for "day", then you should see a result "a great day, because I am" And this is not the case?

And there is now way to install incorrectly thanks to docker

eatingcakeagain commented 2 years ago

Sadly I get the error message still - I even took your excellent example txt (I see what you did there) :-) went on a day and back again and the error is there still. image

Search from an empty day (just in case that makes a difference...) image

PhiTux commented 2 years ago

Okay, thanks very much for the detailed answer (including pictures)! I will try to find the problem. No idea at the moment, what it is...

eatingcakeagain commented 2 years ago

Ok . might it be worth me creating a "new" dailytxt container, and copy-pasting things in from the data export, and searching as I go... that might highlight an cause for the error? If it works then I can continue to use the new version and trash the old one... still doesn't get the rout cause though(?)

PhiTux commented 2 years ago

Yes, that sounds like a good idea to try to find the cause of the error - since you said, that it seemed to work, when you only had few entries made. You could just start a new container with different data-path, so you start completely new. And then just fill this new one slowly and test the search regularly. 👍

eatingcakeagain commented 2 years ago

Update: I have been recreating from the backup/export I made earlier today and searching/testing as I go - so far it is working without the error popping up again. I have noticed that some entries have a lot of history items - is there a way to purge the history on a page and keep only the latest version? could this be causing the error I had before?

PhiTux commented 2 years ago

Strange... Did I understand it right, that you imported it now into a new User-Account in a new docker-container? Then it was perhaps some problem with your encryption-key/user-account!?

The history stays untouched from the search and there is no option to disable the history!

But so it's working now?

eatingcakeagain commented 2 years ago

Not exactly. What I did was....

So yes, it could have been something to do with the encryption-key/user-account. Long story short - it is working. thanks for the help and discussion above.

I have an idea for an small feature - where should I add this in GitHub? (sorry for the noob question)

PhiTux commented 2 years ago

Okay, I'm really pretty sure, that this was some error with the user-account / the JWT. I can not really imagine what the problem was exactly... From this point of information I think that this was not a program error, since the search is something that can not produce such an error, as long as the rest of dailytxt is working normal...

But good, that it works now!

If you have a new feature, please just open a new issue :)

PhiTux commented 2 years ago

By coincidence, I had the exact same error today. And I'm 99% sure I know where it's coming from. It's just a minor programming bug - was neither a problem with your logs/saves nor with you user account/authentication. Really sorry for that!

Will hopefully publish a fixed version within the next days :)

eatingcakeagain commented 2 years ago

Good to hear you hopefully have found the problem - It has not occurred to me since I did the clean install.

PhiTux commented 2 years ago

Yes, but it can reoccur at any time under a specific circumstance ;) The problem lies within empty logs, that are not really empty. When you formerly saved something for a day and then delete it again, then this day is in some special state (intentional), which is obviously not correctly treated by the search.