halkyon/packages/halkyon_base_server/test/unit
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tizian 「ティツィアーン」 554e1604b4
feat(base,app,learn): invitations to shared spaces by mail and by link
The instance's half of Halkyon's ADR 0044, step 5 (D37 to D40).

An invitation by mail (sharedSpace.inviteByEmail) goes out through the
register (send-space-invitation), naming who invites by their handle
and nothing of what is shared, with a link to /join/<token>. The
instance keeps only the address's keyed hash, as for sign-in, and the
SHA-256 of the token. Whoever opens it joins with a code mailed to that
address (EmailCodePurpose.joinSpace, proven through the register,
prove-address-code), so a forwarded mail admits nobody else; a code
proving another address is refused. It lapses after 14 days, and the
hourly pruning forgets it; inviting the address again replaces it.

A space's own link (setJoinLink, the Owner's) admits whoever opens it
as a Viewer (joinByLink) while it is on; switched off and on, it gets a
new token. Its token is kept as it is, so that whoever may invite copies
the link again (joinLink). The page at /join/<token>, in English and
German, says who invites and as whom; preview tells the app the same.

A membership someone else made is new to its member until they mark it
seen (isNew, addedBy; mine names who shared it), for the Inbox.

halkyon_app learns the two new refusals (handleNeeded, otherAddress),
which Learn reports as not allowed until its screens offer these ways
in. The ADR records D37 to D40 and how the instance's half is built.

The migration, the same in the module and in each server including it
(Learn, Meditate, Todo, Train):

  ALTER TABLE "shared_space" ADD COLUMN "joinToken" text;
  CREATE UNIQUE INDEX "shared_space_join_token_idx"
    ON "shared_space" ("joinToken");
  CREATE TABLE "shared_space_email_invitation" (…), with its unique
    indexes on the space and address hash, and on the token's hash,
    and its foreign key to "shared_space" ON DELETE CASCADE;
  ALTER TABLE "shared_space_member" ADD COLUMN "addedBy" uuid;
  ALTER TABLE "shared_space_member"
    ADD COLUMN "isNew" boolean NOT NULL DEFAULT false;

Every space gets no token, and the unique index allows any number of
nulls; every membership gets no one who added it and isn't new, so
nothing already shared shows in an Inbox. The new table starts empty.
None of it rewrites a table, and the server before the switch names its
own columns, so it keeps working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-11 18:36:21 +01:00
..
password feat(base): a reset of the keys without the phrase, and the keys' proof key for a password that signs in (ADR 0020, D31–D34) 2026-10-24 23:24:44 +02:00
profile refactor(profile): handles and profiles move into halkyon_base 2026-10-22 18:11:07 +02:00
simplelogin feat(meditate): Meditate's server, its sealed tables, and SimpleLogin's way back to it 2026-11-04 09:31:56 +01:00
srp feat(crypto): SRP-6a, the register's half and the device's 2026-10-22 18:11:08 +02:00
totp feat(crypto): recovery codes kept under the instance's key 2026-10-22 18:11:10 +02:00
accounts_mode_test.dart build(todo): Todo deployable beside Learn's server, and released as an APK, on F-Droid and as a snap (ADR 0033, step 5) 2026-11-02 16:04:00 +01:00
assistants_config_test.dart feat(base)!: one budget per person for all their assistants, the effort each takes, the operator's lists by page 2026-10-26 16:21:53 +01:00
code_mail_test.dart feat(base,app,learn): invitations to shared spaces by mail and by link 2026-11-11 18:36:21 +01:00
data_location_test.dart halkyon_app: data locations as precise as a country or a state 2026-10-19 18:50:26 +02:00
network_test.dart fix(auth): an IPv6 visitor counts by their /64 2026-10-23 14:12:45 +02:00
offered_ways_test.dart feat(base): signing in with SimpleLogin through the register (ADR 0020, step 2) 2026-10-24 09:17:48 +02:00
password_config_test.dart feat(base,app)!: GitHub signs nobody in any more (ADR 0020, D36) 2026-10-26 07:16:39 +01:00
source_code_test.dart halkyon_base: a Serverpod module for sign-in, accounts and instance basics 2026-10-19 14:29:28 +02:00