You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why do we need to create the ZimFileReader object and set it to the reader if we open the note for the file that is not currently opened in the reader.
#4180
Open
MohitMaliFtechiz opened this issue
Jan 20, 2025
· 3 comments
· May be fixed by #4183
Describe the bug
Why do we need to create the ZimFileReader object and set it to the reader if we open the note for the file that is not currently opened in the reader? Since when opening the note user only wants to see or edit the current note. For this, we have all the things already available in the database like filePath, noteTitle, and ZimUrl, etc, and we only need these things to update the note so why are we creating the ZimFileReader object and setting it to the reader? IMHO, we should not create the ZimFileReader and set it to the current reader because the user only wants to open or edit the note, and creating the ZimFileReader is a resource-intensive task because there can be huge ZIM files. Also, it does not make sense to set the ZIM file in reader for the currently opened note because there is one more option "OPEN ARTICLE" which directly opens the ZIM file and loads the page of note.
@kelson42 While fixing the #3937 I found this issue. I see no good reason for creating ZimFileReader and setting it to the current reader. It was introduced very long ago do you think it is still a good idea?
Describe the bug
Why do we need to create the ZimFileReader object and set it to the reader if we open the note for the file that is not currently opened in the reader? Since when opening the note user only wants to see or edit the current note. For this, we have all the things already available in the database like filePath, noteTitle, and ZimUrl, etc, and we only need these things to update the note so why are we creating the ZimFileReader object and setting it to the reader? IMHO, we should not create the ZimFileReader and set it to the current reader because the user only wants to open or edit the note, and creating the ZimFileReader is a resource-intensive task because there can be huge ZIM files. Also, it does not make sense to set the ZIM file in reader for the currently opened note because there is one more option "OPEN ARTICLE" which directly opens the ZIM file and loads the page of note.
See
kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/page/notes/viewmodel/effects/ShowOpenNoteDialog.kt
Line 61 in 6272219
Expected behavior
It should not create the ZimFileReader as it is a resource-intensive task and we are doing it for no reason.
Environment
The text was updated successfully, but these errors were encountered: