Search with text longer 255 characters can't be synced.

I have the following search in the macOS application:

(Perfetti.{0,5}(Method|Konzept|concept|approach))|(Cognitive exercise therapy)|(cognitive therapeutic exercise)|(Neuro(c|k)ognitive rehabilitation)|(Cognitive exercise treatment)|((affolter|bobath|\WSI\W).*perfetti)|(perfetti.*(affolter|bobath|\WSI\W))|(Kognitiv.{0,5}therapeutische Übungen)|(nach perfetti)|(cognitive sensory motor training therapy)

It brakes the sync, because the server doesn't accept search strings >255 characters. See report ID 1969518297.

Either the macOS application should not allow long search strings, or the server should accept them.
  • Where exactly do you have that search? That's not a Zotero search string -- Zotero will let you store things in the title field that are longer than what it syncs: I believe that's on purpose, but quite rare to happen with regular use.
  • edited March 16, 2024
    I assume this is talking about a regexp-mode Attachment Content search condition in a saved search.

    And yes, since Zotero has always been an offline-first app, we've historically not enforced field lengths locally, so as to not throw away saved data or, for a case like this, place limits on what can be done locally. Whether that approach still makes sense now that syncing is the norm is up for debate.

    I don't think we've ever seen anyone try something like this, though, and I don't see us increasing the limit. You should be able to recreate this search using multiple search conditions (if necessary in a separate saved search that's included via a Collection condition).
  • Yes, it is a regexp attachment search.

    From a users perspective I think, that everything the "offline" mode allows should be supported in sync mode. If for technical reasons, it can't be supported in sync mode, it should at least not break it.

    Maybe just skip those entries and show a warning, which entries couldn't be synced and why?

    Or give me the option to exclude specific items from sync?

    At least the error message in the sync window should be more specific. The plaintext just says "Search value cannot be longer than 255 characters" but doesn't mention, which search item is the culprit.
    The error submit dialog is also not very helpful for an end user "[JavaScript Error: "Error 400 for search RC3XBKXH in Meine Bibliothek:" I couldn't find the id RC3XBKXH anywhere in the UI.
  • The current error message obviously isn't ideal, and we'll create a ticket for it, but as I say, you're the first person to report this and quite possibly the first person to ever try a search like this. For item fields that are too long to sync, the error popup will include a button to show the item in question.
    Maybe just skip those entries and show a warning
    That's what happens. Other data should continue to sync.
  • Currently that's not what happens. The sync completely stops.
Sign In or Register to comment.