Modified Duplicate Collections Don't Persist (Mobile)

Description of the bug
After duplicating a standard collection, in my case “thoughts” and editing its filters and properties (name etc), edits don’t persist after app reopens. At first he modifications seem to save an work fine, but it seems like the modifications are lost on the next sync or something and on the next open I just end up back with the original duplicate.

App & Version
iOS App v3.1

Steps to reproduce
Duplicate the standard thoughts collection. Modify its name, filter, icon, color. Leave the app and reopen within this collection, modifications will be reset and the original duplicate is restored.

Screenshots / Screen Recording
I will try to add this if I can and repro on desktop later.

After some further investigation, it seems to have to do with particular filters, not duplicates.

If I define the following collection:

{
          "type": "group",
          "op": "and",
          "filters": [
            {
              "type": "parent_count",
              "op": "equals",
              "arg": 0
            }
          ]
        }

The collection only persists temporarily during the active session and does not sync. Thus it is not available on other devices and disappears if the session ends (log out). When I try to save this collection, I do see the following error in the console:

PATCH https://api.supernotes.app/v1/collections/0528b32c-96cc-4140-a555-a0657bd17383 422 (Unprocessable Entity)

Weirdly enough, a separate instance of such a collection does seem to at least persist in the web app, but it never seems to sync to the desktop app or iOS mobile app.

  • er scratch that. It disappeared from the web app as soon as I logged out and back in again.

AI to the rescue. If I generate this filter using AI superpowers, it does seem to actually persist and sync once I log out and log in again across the various platforms. Here’s the diff in the filter definition:

{
  "type": "group",
  "op": "and",
  "filters": [
    {
      "type": "parent_count",
      "op": "equals",
      "arg": 0,
      "name": null,
      "inv": null,
      "case_sensitive": null
    }
  ]
}

However, if I attempt to change any of the properties of this collection (name, description, icon) the same 422 POST error occurs and changes do not save.

Hi @solsen, are you still having issues? We’ve made some improvements to collection syncing and persistence both in SN 3.1.1 and SN 3.1.2, so hopefully things should be good to go now.

So, I just now noticed that when you duplicate a collection like “thoughts” the resulting url has the special “thoughts” identifier, even if you change the collection name afterwards. I suspect it is the clash of this identifier with the original collection’s special identifier that causes this issue.

The current workaround is to just copy the defined filters and create a new collection using them directly instead of using the duplicate functionality.