Skip to content

perf: accounts with no rooms re-probe all legacy delegates on every load (done seal lives in localStorage) #761

Description

@sanity

Problem

The legacy-migration "done" seal (mark_legacy_migration_done / is_legacy_migration_done) is a localStorage flag. In production the app runs in the gateway's sandboxed iframe, where localStorage is unavailable (SecurityError), so the seal is never written.

Accounts with rooms are unaffected: their current delegate lists room: keys, and that load path never probes legacy. But an account with no rooms takes the ProbeLegacy path on every page load. Each load then fires, to every one of the 29 registered legacy delegates:

  • GetRequest for rooms_data;
  • GetRequest for outbound_dms;
  • a ListRequest.

The freenet-migrate walk runs on top of that. Every brand-new visitor on a hosted node pays this cost on each load, which is the class of per-load overhead #757 is about.

Why it was not fixed in #758

Moving the seal into the delegate store would turn a never-active "never probe legacy again" decision on in production. The seal is requested by any definitive answer, including the "delegate not found" door, and it lands at quiescence, which can also be reached when some generations were merely silent. Activating that needs its own review of when "done" is safe to make permanent, so a silent generation's rooms are not skipped for good.

Possible direction

Store the seal in the current delegate, as #758 does for the in-progress marker. Gate it on every probed generation having answered definitively, with no silence or timeouts.

[AI-assisted - Claude]

Activity

  1. sanity commented on Oct 9, 2026

    @sanity
    ContributorAuthor

    Design for durable, verifiable migration completeness (needed before the #758 delegate re-key can ship, and the general fix for #760's class of bug): freenet/freenet-migrate#37. #758 is parked as a draft until it lands.

    [AI-assisted - Claude]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions