fix(atlas): share the wish form and tour figures, mark the people reads

- lint:dup: the add-a-wish form state and the tour figures of the hub were
  written twice, once per view; they live in useWishAddForm and
  tourHubFigures now, and both views read them.
- lint:tx: AtlasPeopleService.profile only writes through the region cache
  refreshes of the Atlas reads it calls, each complete on its own, so it is
  marked @txStandalone.
This commit is contained in:
Maurice
2026-11-29 00:53:28 +01:00
parent 6068c34c35
commit e6ba039abc
7 changed files with 83 additions and 53 deletions
@@ -99,6 +99,14 @@ export class AtlasPeopleService {
};
}
/**
* One traveller's counts and badges, read through the Atlas reads the user's
* own Atlas uses.
*
* @txStandalone its only writes are those reads' region cache refreshes, each
* complete on its own and safe to repeat, so nothing a caller does around
* them needs to share their transaction.
*/
private async profile(id: number): Promise<{ person: Omit<AtlasPerson, 'badges'>; badges: Badge[] }> {
const stats = await this.atlas.stats(id);
const visited = (stats.countries as Array<{ code: string; status?: string; firstVisit?: string | null }>).filter(