feat(icons): propagate icon_custom through export / import / sync

Follow-up to 18fe13a: the custom-icon flag now survives round-trips instead
of resetting to fetched on a restore.

- Containers write icon_custom: manual export (doExport), auto-backup, sync
  snapshot; parseEntriesFromJSON carries it back (default 0 when absent, e.g.
  foreign CSV).
- encryptImportEntry ships it in the body (shared by bulk-import + sync
  create/update).
- Server create + bulk-import INSERTs read icon_custom
  (GetValue<Boolean>('icon_custom', False) → 0 default). An empty icon always
  forces icon_custom=0.

Now a custom icon stays custom after export→import and across sync — it won't
be silently reclassified as cache and clobbered by Re-fetch-all on the other
device.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-25 15:21:04 +01:00
parent 18fe13a861
commit a6ba0100ee
5 changed files with 24 additions and 8 deletions
+6 -4
View File
@@ -270,10 +270,12 @@ La SEULE feature qui sort sur le réseau côté Delphi (HIBP est côté JS).
skippe `icon_custom` (même sur "Re-fetch all"), `DELETE /entries/icons/all`
filtre `COALESCE(icon_custom,0)=0`. Seul l'utilisateur change/retire une
custom, par entrée (boutons Upload/Remove du slideover). `GET /entries`
echoe `icon_custom`. **Non propagé** par import bulk / sync / export
(l'INSERT bulk ne lit pas le flag) → une icône restaurée sur un device
neuf compte comme fetchée ; assumé (les customs sont surtout des sites
self-hosted, que DDG ne re-fetch pas de toute façon).
echoe `icon_custom`. **Propagé** de bout en bout : export manuel,
auto-backup, snapshot de sync l'écrivent ; `encryptImportEntry` le porte
dans le body ; les INSERT **create + bulk-import** le lisent
(`GetValue<Boolean>('icon_custom', False)` → 0 par défaut si absent, ex.
CSV étranger). Round-trip export→import et sync préservent donc la
provenance. Une icône vide (`icon_b64=''`) force toujours `icon_custom=0`.
- Bulk : `DELETE /entries/icons/all` purge le cache auto (bouton "Clear
cache") — préserve les uploads custom
- Render : `entry-avatar` contient `<img class="entry-avatar-img">` si