Accounts and histories
A dataset holds one history at a time for its readers. A new one starts when the data is someone else's, and the old one is kept, out of readers' sight, until it's deleted or ages out.
- By host. Without
account, whose data it is means the source's host:api.parcel.app. Point the source at another host and a new history starts. - By
account. For a service where one secret reaches several accounts, cars or workspaces, name the field that says which:"account": "{account.id}". A value that changes starts a new history with that answer. An answer with no value there isn't kept. - By secret. Legato notices when the value of the source's secret changes, without keeping it: it keeps a fingerprint (an HMAC made with a key of this Mac's own, in the Keychain). Renaming the secret in Settings → Secrets changes nothing.
What pauses
Some changes need you to say what they mean. Until you do, the page's cards keep updating from each answer, but nothing is kept:
| Settings → History says | Because | Your choice |
|---|---|---|
| Paused: the secret changed. Is this the same account's history? | The secret's value changed | Continue this history if it's the same account with a new key or token; Start new history if it's someone else's |
| Paused: the page now keys its rows differently. Re-key keeps this history under the new key; rows it can't key are left out. | key changed, with rows already kept | Re-key this history recomputes keys from the stored fields; Start new history starts an empty current history |
| Updating what's kept to the page's new rules… | Retained fields, text removal or date rules changed | Collection waits while all retained histories are updated |
| Paused: what's kept couldn't be updated to the page's new rules. Nothing was changed. | A migration failed | Try again retries the required changes; Start new history starts an empty current history; the older histories are still updated to the new rules |
- A lost Keychain key doesn't pause. If Legato's own key is gone or replaced, it starts checking again from the next answer, and Settings says "The check that the secret hasn't changed started again once, after Legato's key for it was replaced. Nothing was paused."
- An unreadable key doesn't pause either. Settings says "Can't check whether this history's secret changed right now: Legato can't read its key for that. History keeps collecting."
- Changed rules apply to what's already kept. A change to
fieldsorremove_aftercuts the stored rows to the new rules, and a change todate,time_zoneordate_rangeworks their dates out again, in every history. Collecting waits while it does. A field already left out doesn't come back by adding it tofields. If the update fails, nothing is changed and collecting stays paused. - Re-key works from the rows as kept. A row the new key can't be made from is removed. When two rows get the same key, the one seen most recently stays, with the earlier first-seen time. Settings says how many were merged and removed. A re-key that fails is tried again, even after Legato restarts.
- A changed secret is asked about first. If the secret and the key both changed, continuing the same account's history still leaves the key question to answer. Starting a new history skips re-keying the old rows, but not updating them to new rules.
legato rows add into a paused history is refused (paused), with the reason.
Readers and grants
Grants are kept on the Mac, not in page files, so editing a page can't take over someone else's history.
- The owner is the page that first collected the dataset, by its id (its file name without
.json). Rewriting its file, withlegato set, an agent or an editor, keeps it the owner. - Its
readersmay read the history while it's the owner. Take a page out of the list and it can't read from the next scan, unless it was also granted in Settings → History. - Settings → History → Grant lets another page read too, from a menu of the folder's pages, and Revoke takes that back. A grant is for the page with that id: a page saved under another id needs its own.
- The owner can read its own history with a dataset source, without listing itself.
Renaming the owner, and transfer
Renaming the owner's file looks to Legato like the owner going and a new page arriving that wants the same history. The new page doesn't get it:
- Settings → History shows "Also claimed by" with "Delivery log declares it too. It may be Packages, renamed." and Transfer to this page. Only that button changes the owner.
- A transfer keeps the readers already granted. After it, a page added to the new owner's
readerscan read only once you grant it in Settings → History. - The claim goes once the other page stops declaring the dataset.
The 30-day countdown
When no page in the folder collects a dataset any more (its owner was deleted, renamed, or lost its collect), Settings says "The page isn't collecting it any more. Deleted in 30 days unless it comes back or it's transferred." It counts down by the day:
- It comes back: the owner page declares
collectfor it again. The countdown stops. - It's transferred, to a page that claims it. The countdown stops.
- Otherwise, after 30 days the dataset is deleted, every history in it.
A page that's in the folder but can't be read (a typo, or a file half written) doesn't start the countdown: its histories wait. Nor does a license that has ended; nothing is collected without one, and the history stays.