NotePad icon indicating copy to clipboard operation
NotePad copied to clipboard

Notes disappear when sorting by date

Open JJ840 opened this issue 1 year ago • 5 comments

Describe the bug

Notes disappear when sorting by due date and don't show up. They aren't lost and return when sorting via another method, but the only thing that shoes up when sorting by due date is the day headers and not the actual items.

how To Reproduce

Open left hand menu Long click on a list Sort by Due Date

If applicable

  • add the stacktrace
  • add logcat output as explained here

Technical information

  • Device: Pixel 6 Pro
  • OS: GrapheneOS 2024020500
  • app version: 7.1.7
  • app commit id (only for nightly builds):

Sorting via the 3 dots menu on the upper right also doesn't change the sorting method. Tried backing up and restoring, didn't change anything.

JJ840 avatar Feb 07 '24 05:02 JJ840

i tried making a list and sorting by date, but i can't replicate. This happens in the app, not in the widget, correct ?

i will try it on other devices in the future, to see if i can replicate.

Sorting via the 3 dots menu on the upper right also doesn't change the sorting method

that menu is a placeholder, the feature is still a work in progress

CampelloManuel avatar Feb 09 '24 13:02 CampelloManuel

I can't replicate. I will publish an update in a few days. Can you try uninstalling the app, installing that update, and rewriting the notes to see if it still happens ?

CampelloManuel avatar May 01 '24 09:05 CampelloManuel

@JJ840 update 7.1.8 is now available. Can you verify if the bug is still present ?

CampelloManuel avatar Jun 22 '24 09:06 CampelloManuel

Yeah, I'm still experiencing it. I'm wondering if my notes file is just corrupt, but it still doesn't work when I add new notes. Very weird.

Jun 22, 2024 5:47:07 AM Campello Manuel @.***>:

@JJ840[https://github.com/JJ840] update 7.1.8 is now available. Can you verify if the bug is still present ?

— Reply to this email directly, view it on GitHub[https://github.com/spacecowboy/NotePad/issues/525#issuecomment-2183962956], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ATMQAZG65L6FU3BWKDP4NCLZIVBY7AVCNFSM6AAAAABJXJTD7KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTHE3DEOJVGY]. You are receiving this because you were mentioned. [Tracking image][https://github.com/notifications/beacon/ATMQAZGDAVY4N2Y4LKIT7QTZIVBY7A5CNFSM6AAAAABJXJTD7KWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUCFSQUY.gif]

JJ840 avatar Jun 22 '24 13:06 JJ840

I can now replicate this on a Google Pixel 8a with the stock rom on Android 14. Updates:

  1. It does not affect how data is saved in the DB, because the app exports the notes correctly
  2. It does not happen on the android emulator for API 34
  3. It happens as far back as in version 6.0.0-beta5
  4. It happens both on a physical google pixel 8a and on the API 35 AVD image of the SDK
  5. The code to present the GUI already receives incorrect data, so it's not a GUI issue
  6. SQLite version
    • on the Google Pixel 8a: 3.32.2 ; bug is present
    • on the API 34 emulator: 3.39.2 2022-07-21 ; bug is NOT present
    • on the API 35 emulator: 3.44.3 2024-03-24 ; bug is present
  7. The problem is in query() in MyContentProvider.java where the line .query(Task.getSECTION_DATE_VIEW_NAME(listId) runs this sql
SELECT _id, title, note, completed, due, updated, lft, rgt, dblist, locked FROM sectioned_date_view_1 WHERE dblist IS '1' ORDER BY secret_typeid,due,secret_typeid2

The query says WHERE dblist IS '1' but some records are saved with dblist = '1' and some with dblist = 1. Android versions up to API 34 did not care about this difference, but on the Google Pixel 8a and on the API 35 AVD image of the SDK, '1' is not equal to 1 in SQLite queries, so the notes are not taken from the database, leading to only the headers being shown.

Also, on the API 34 emulator, on the view sectioned_date_view_1 column dblist is created as INTEGER type, while on the API 35 emulator, it's a BLOB type.

CampelloManuel avatar Sep 10 '24 20:09 CampelloManuel

@JJ840 update 7.1.9 is now available on f-droid and the play store. The bug with the dates should be fixed. Can you try the app and tell me if it works ?

CampelloManuel avatar Sep 19 '24 19:09 CampelloManuel