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

When I point the parent_id of a directory to the slave, the whole program should die #3334

Closed
rxliuli opened this issue Jun 6, 2020 · 3 comments
Labels
bug It's a bug database Database issues high High priority issues

Comments

@rxliuli
Copy link
Contributor

rxliuli commented Jun 6, 2020

It happened when I used api PUT /folder/:id to modify the parent_id of the directory

image

What I want to know the most is how to restore my data, because Joplin can't be opened (as shown above)

Environment

Joplin version: 1.0.199.2381
Platform: Windows
OS specifics: Windows 10

Steps to reproduce

  1. Use PUT /folder/:id and pass the parameter {id:'', parent_id:''}, where parent_id is the child of id
  2. The entire program is stuck, and exiting and re-entering will not help, it looks like it has encountered a fatal logic error (I guess Joplin did not deal with this edge situation)

Describe what you expected to happen

  1. When I call the API PUT /folder/:id for this illegal operation, an exception should be thrown for prompting!
  2. If possible, please package the beta version, one for daily use, and the other beta can be developed and tested, otherwise it is quite dangerous, such as the current situation

Logfile

log.txt

@rxliuli rxliuli added the bug It's a bug label Jun 6, 2020
@laurent22 laurent22 added high High priority issues database Database issues labels Jun 6, 2020
@rxliuli
Copy link
Contributor Author

rxliuli commented Jun 7, 2020

Found another related problem, when I want to reinstall Joplin upgrade, but the new program can not synchronize data to the local, the error message is:

FetchError: On file a793ec58d9da403a9fce5f8d10e52f59.md: network timeout at: https://public.bn.files.1drv.com/y4mlgUBGWFYo234SDrPff8p3h_NPvorw77kcs8iJGyO0cZbFtojXVmtK25WWa2O3eQfBeHuJtPAAjHeGWdfH_Tqw12-Zws9xghz1q86TwdPSaSGOiM7qpLR8-PNiXlRV1cspykpdM8B-iCT44cSpM6K2bosTA-H1pPasHcLkaGnWBpFeF3eFa3SIeQotCxfC7BAJbeQ4ey5z10_86tu_viHD1JQJ_NcIPt6bMQ8CVfK0Sk/a793ec58d9da403a9fce5f8d10e52f59.md

@rxliuli
Copy link
Contributor Author

rxliuli commented Jun 7, 2020

What if parent_id is sub_id? I see that it does not seem to be processed

@rxliuli
Copy link
Contributor Author

rxliuli commented Jun 7, 2020

For examples, the folder structure may be as follows

-id1
   -id2

At this time, the parent_id of id1 is specified as id2, is it still not processed yet?

I have two solutions

  1. Change parent_id every time to check whether perent_id is a child of the current folder. If it is, an exception is thrown. The specific operation is to get parent_id until root. If the id of the current folder is found, then Throw an exception.
  2. When creating or modifying each folder, add a path field, save the full path of the folder (id path), and then directly compare it.

@lock lock bot locked and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug It's a bug database Database issues high High priority issues
Projects
None yet
Development

No branches or pull requests

2 participants