Start every Rule private, with a rotating link and files that follow its readers.

New Rules stay off lists until the person who holds the pen turns on a share link, or the team features one. Uploaded files are readable only by those readers, stripped of location metadata, and deleted with the Rule, draft, or account.
This commit is contained in:
adilallo committed 2026-11-09 19:54:04 -07:00
1 parent 642551064c
commit 5cbda35e32
50 files changed
+2429 -219

No files matched your search

+9 -17
View File
@@ -3,34 +3,26 @@ import {
LISTED_PUBLISHED_RULE_WHERE,
isListedPublishedRule,
} from "../../lib/publishedRuleAccess";
import { RULE_VISIBILITY } from "../../lib/ruleVisibility";
describe("isListedPublishedRule", () => {
it("lists owned rules", () => {
it("lists public and featured Rules only", () => {
expect(
isListedPublishedRule({ userId: "user-1", claimTokenHash: null }),
isListedPublishedRule({ visibility: RULE_VISIBILITY.public_and_featured }),
).toBe(true);
});
it("lists ownerless rows that are not waiting on a guest claim", () => {
expect(isListedPublishedRule({ userId: null, claimTokenHash: null })).toBe(
true,
);
});
it("keeps guest-claim rows unlisted", () => {
expect(
isListedPublishedRule({
userId: null,
claimTokenHash: "claim-hash",
}),
isListedPublishedRule({ visibility: RULE_VISIBILITY.private }),
).toBe(false);
expect(
isListedPublishedRule({ visibility: RULE_VISIBILITY.shared_by_link }),
).toBe(false);
});
});
describe("LISTED_PUBLISHED_RULE_WHERE", () => {
it("matches owned rows or rows with no claim token", () => {
it("matches public and featured rows", () => {
expect(LISTED_PUBLISHED_RULE_WHERE).toEqual({
OR: [{ userId: { not: null } }, { claimTokenHash: null }],
visibility: RULE_VISIBILITY.public_and_featured,
});
});
});