Repository navigation
Conversation
- Removing a person, or merging a lead or visitor whose vote collides with the person's, takes the vote off the post's stored vote_count (on the canonical post of a merged thread) in the same transaction. - Companies created in the admin are 'manual', not 'api'. - The user and company attribute dialogs show a refused create or edit (for example a duplicate key) and toast a refused delete. - vote_count and comment_count segment rules count post_votes and live post_comments instead of tables that do not exist. - Evaluating every segment isolates each one: a failure is logged and reported and the rest still run. - Evaluation no longer reports a person held by another source as added. - REST DELETE segment members counts only rows it removed. - A schedule is accepted only if the scheduler's cron parser accepts it. - A dynamic segment's rules cannot be cleared.
…raph The createSegment/updateSegment schema is part of the client entry, so validating with the scheduler's cron parser there shipped that parser to every page. The segment service now refuses a pattern the parser rejects, with the same message.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes product bugs found by the people e2e journeys quarantined in #1156 and #1170.
Fixed journeys
posts.vote_count, in the same transaction as the delete.post_votesre-point step, so the admin lead merge, the anonymous sign-in or identify merge, and the signup absorb all get it.manual. API callers keep theapidefault.vote_countandcomment_countsegment rules now countpost_votes(hard-deleted) and livepost_comments(deleted_at IS NULL). Before, they queriedvotesandcomments, which do not exist. The table parameter is now a union type, so a wrong name fails typecheck.{ segmentId, error: 'Evaluation failed' }, and the remaining segments still run. Successful entries keep the{ segmentId, added, removed }shape.api,widget,manualorssois no longer reported as added on every run. Removal still applies only to rows that evaluation added (dynamic).removeMembernow reports whether it deleted a row, and RESTDELETE /api/v1/segments/:slug/memberscounts only real removals.parseCronaccepts it. The check runs in the segment service, because the server function schema is part of the client entry and validating there would ship the parser to every page.99 99 * * *and six-field patterns are now refused.*/15-style steps are now accepted; the old regex refused them although the scheduler supports them. The message is unchanged: "Must be a valid cron expression".updateSegmentrefusesrules: nullor an empty condition list on a dynamic segment (the sameVALIDATION_ERRORas create), so the segment keeps its members.Notes
post_votesrows behind it (import-service.ts), so a recount would erase it. The delta applies to the thread's canonical post and counts each voter once per merged thread, and test customers' votes, which were never counted, are skipped. This also covers a merge where the lead voted a merged duplicate and the user voted its canonical post.segment.member.removed, which an existing test pins as intentional.QUARANTINE.mdentries live on test(e2e): people journeys (users and companies) #1156 and test(e2e): people journeys (segments) #1170. Un-quarantine them there once this merges.fix/rest-people-errors(removePortalUser) andfix/rest-input-errors($slug.members.ts). Neither change is repeated here.Tests
Each fix has a test that failed on
mainfirst:remove-portal-user.db.test.ts: counts drop, including on a merged thread.user-merge.db.test.ts: a collision, a moved vote, and a collision across the same thread.merge-anonymous.db.test.ts: a collision.segment-evaluation.db.test.ts: covers G-06, G-11, G-50 (a forced failure), G-15 and G-13.segment-membership.test.ts:removeMemberreturns a boolean.routes/api/v1/segments/__tests__/segment-members.test.ts: theremovedcount.companies-create.test.ts: the company source.scalar-attribute-list.test.tsx: refused create, edit and delete.Local checks: oxlint, prettier, typecheck,
bun run build,check:server-fn-manifestandcheck:widget-bundle.