Skip to content

Scenario: a pet renamed twice while everyone follows it - #327

Merged
renrenmimi merged 1 commit into
mainfrom
functions/scenario-pet-names
Oct 14, 2026
Merged

renrenmimi merged 1 commit into
mainfrom
functions/scenario-pet-names

Conversation

@renrenmimi

Copy link
Copy Markdown
Owner

Adds a petnames group to functions/scripts/scenario-many-users.mjs. The pet's owner renames it and gives it a new photo twice in a row, while everyone else follows it and it is on a meetup's roster. Every copy of its name and photo has to end with the last ones: on its posts, the follow lists and the roster. Its post count must not move.

On the test project, with onPetUpdated (#325) deployed there:

People Copies with the last name and photo Post count
6 8 of 8 (2 posts, 5 follow lists, 1 roster) 2 before, 2 after
200 202 of 202 (2 posts, 199 follow lists, 1 roster) 2 before, 2 after

Cleanup left nothing.

🤖 Generated with Claude Code

petnames: a pet is renamed and given a new photo twice in a row by its
owner, while everyone else follows it and it is on a meetup's roster.
Every copy of its name and photo, on its posts, the follow lists and the
roster, has to end with the last ones, and its post count must not move.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 23:26
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pet-note Ready Ready Preview Oct 14, 2026 11:26pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T23:29:01.706353Z 14f316f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@renrenmimi
renrenmimi merged commit 98c877d into main Oct 14, 2026
6 checks passed
@renrenmimi
renrenmimi deleted the functions/scenario-pet-names branch October 14, 2026 23:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14f316fe51

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const steps = [];
for (const k of [1, 2]) steps.push(await call(owner, "updatePetCallable", { petId: star, name: `Simpet ${SHORT} v${k}`, avatarUrl: photo(k) }));
const lastName = `Simpet ${SHORT} v2`;
const end = await settle(petCopies, (c) => outOfStep(c, lastName, photo(2)).length === 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the pet propagation trigger before enabling this scenario

With the reviewed commit alone, the documented default emulator run always times out here and exits unsuccessfully: a repo-wide search finds no onPetUpdated handler, and functions/src/index.ts exports no pet-update trigger, while updatePetCallable only updates pets/{petId}. Consequently the existing posts, follow-list entries, and participant record can never acquire lastName or photo(2). The propagation implementation needs to land with this scenario, or the scenario must not run by default until that dependency exists.

Useful? React with 👍 / 👎.

Comment on lines +906 to +907
check("pets: renamed with a new photo twice in a row, every copy ends with the last",
steps.every((st) => st.ok) && end.follows.length === tally(follows).ok && end.roster.length === 1 && left.length === 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require every follower request to succeed

If any followPetCallable requests fail—for example because of a regression or transient callable refusal—the assertion still passes with fewer follow-list copies because it only compares the resulting count with tally(follows).ok. Even zero successful follows can pass once the posts and roster are synchronized, so this does not enforce the stated scenario that everyone except the owner follows the pet; include tally(follows).ok === N - 1 in the result.

Useful? React with 👍 / 👎.

];
// Every follow is in place before the renames start.
await settle(petCopies, (c) => c.follows.length === tally(follows).ok);
const postCount = (await adminGet(`pets/${star}`))?.postCount;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Settle the post count before capturing the baseline

When post aggregation is delayed, this read can capture the pet's initial or partially updated postCount, because createPostCallable creates posts with an empty contribution and onPostWritten updates the pet asynchronously. The later synchronization wait gives that trigger time to finish, after which the final comparison reports that renaming changed the count even though only the earlier post events did. Settle this pet's count to the expected number of existing posts before recording the baseline.

Useful? React with 👍 / 👎.

This branch was successfully deployed

1 active deployment
Preview — 14f316fe Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants