Public: anyone can read this; the crew can change it.

The owner mutes a repository once, and its asks leave the inbox and the phone but not its own page #1698

opened this

Merged 52d 2h ago, live in production

A repository can now be muted from the home's needs-you, and its asks leave the home, /live/on-you, /api/v1/asks and the phone push. They stay visible and counted on the repository's own page.

Notes

opened this

A repository can now be muted from the home's needs-you, and its asks leave the home, /live/on-you, /api/v1/asks and the phone push. They stay visible and counted on the repository's own page.

The last try (#1651) was parked on a failure in test/capacity.test.ts ("report mode is loud… reported: the Capacity page says it once"). Nothing in this change touches the Capacity page. I couldn't reproduce that failure. The test passed in isolation and in the full file, three runs in a row. The branch had also fallen behind main, which has since changed vitals() and the health lines. I merged current main into the branch; the only conflict was the imports in src/web/studio/asks_page.ts.

After the merge, tsc --noEmit is clean. These pass: test/capacity.test.ts, test/asks.test.ts, test/asks-expiry.test.ts, test/check-list.test.ts, test/asks-mute.test.ts and test/home.test.ts (35 tests, 0 failures). I did not run the whole suite. The forge's check does that on this push.

  • Mute: it is saved per user, per repository, and set from a chip on the needs-you.
  • Tests: test/asks-mute.test.ts covers that a muted repository's pull is not in /live/on-you, that unmuting brings it back, and that its page still counts it. It is named in GATE in scripts/gate.ts.
  • Local env: the sandbox sets FORGE_CHECK_SHARDS=6, which makes one capacity test fail locally. I unset it for my runs. It is a local artefact, not a code problem.
  • Left out: muting a repository for everyone, and muting for a time. This mute is per user and stays until you unmute it.

To try it, open the home, use the mute chip on a repository's asks, and watch them leave the home and /api/v1/asks. Then open the repository's page and see its asks still counted.

Closes #1597

2 earlier comments
commented

All four review points are fixed and pushed. The type check and the 46 asks tests pass. I did not delete the canRead check to confirm the new test fails without it.

  • canRead refusal: the test now has Alice make a private repository secret, and Bob posts its real id to /asks/mute. It asserts a 404 and that mutedRepos(db, bob.id) stays empty. The nope case stays as the unknown-id check.
  • Repository page: askingLine only renders on the app page, so the test registers the repository as an app. It then fetches /alice/muted as Alice while it is muted and asserts id="repo-asks" and (muted from your home).
  • Doc comments: rowCard's comment is back above rowCard, and mutableRow keeps its own.
  • 200-repository cap: silencedRepos(db, user) now loads the viewer's muted ids with mutedRepos and getReposByIds, then filters by canRead. Its caller in needsYouSection no longer passes a repository list.
commented

I merged main into the branch and pushed it. The type check is clean and bun test asks mute passes (46 tests). I did not run the whole suite; the forge's check runs that on the push.

  • src/http/server.ts: the only file with conflict markers. Both sides had added routes in the same spot, so I kept all of them: /asks/mute from this pull, and /asks/decide and /asks/decide/:id/undo from main.
  • src/web/studio/asks_page.ts: git merged this one without markers, but getRepoById ended up imported twice. I removed the duplicate import and folded ownerFactRepoIds into the single repos.ts import.
commented

I merged main into the branch again and pushed it (1dd7f034). This time git merged it without conflicts, including src/http/server.ts. The /asks/mute, /asks/decide and /asks/decide/:id/undo routes are all still registered there.

The type check is clean and bun test asks mute passes (46 tests). I did not run the whole suite; the forge's check runs it on the push.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs