mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
nextStateDeputyIdsAfterMunicipalityMembership was the third byte-for-byte copy of the same single-id delta — nextAdvisorIdsAfterMembership and nextStateDeputyIdsAfterMembership differ from it only in which cap they read — so the algorithm now lives once in nextIdsAfterMembership with the cap as data, and the three named wrappers just bind their own. The three cloned spec files became one describe.each suite: coverage went up rather than down, since every relation now gets the "can go to zero" and no-mutation cases only B37's clone had, plus an explicit assertion that each wrapper refuses at ITS cap with ITS message. That pairing matters because mapCampaignFormActionError matches thrown messages against safeMessages by exact string, and two of those cap messages were bare literals in three src places each (thrown, plus two independent allowlists): rewording any one would have silently collapsed a real refusal into "tente novamente". Both are constants now, next to their caps, following the MUNICIPALITY_STATE_DEPUTIES_CAP_MESSAGE precedent already in those same files. The dobradinha staff message had the same exposure in four places — and actions/stateDeputy.ts already imported the constant while restating it as a literal one line below — so it is STATE_DEPUTY_STAFF_MESSAGE (renamed: it guards create/update too, not just the batch), and the conflict message it shares with the create route is named too. The batch action stopped resolving the dobradinha slug before its loop: the slug exists only to target the revalidate, which the caller already skips when nothing changed, so on a no-op batch that read was fetched and thrown away — the guard setLeadershipMunicipalitiesMembershipRecord already had. Its redundant second dedup is gone (the schema's transform already deduped; the sort stays, for deadlock-free lock ordering), and the bare 435 shared with the advisor batch is MAX_MUNICIPALITIES_PER_BATCH. Two memoization gaps closed, both restoring invariants the codebase had already established elsewhere. An advisor's scoped .filter() returned a fresh array per row, defeating the WeakMap that exists precisely to share derivations across rows, so scopedPortfolioIndex memoizes on (index, addableIds) and every row gets one array. And LeadershipStateDeputyRelationCell called matchesAtWordStart per candidate, paying an NFD pass plus three Unicode regexes on both sides per keystroke over the unpaginated leadership catalog — the cost wordStartFilter's own doc comment warns about; it now normalizes the query once against labels cached on options, like municipalityPortfolio. Rejected with reason: maxItems on the dobradinhas cell. A dobradinha has no product ceiling on municípios (that is why the bound is the catalog), so a "generous 30" would invent a rule that refuses a legitimate statewide dobradinha, and the honest 435 is unreachable when ids are unique. Also dropped the dead addPlaceholder knob no caller ever set. |
||
|---|---|---|
| .. | ||
| activityUi.unit.spec.ts | ||
| advisorSchema.unit.spec.ts | ||
| bahiaElectionAggregates.unit.spec.ts | ||
| bahiaMapStyle.unit.spec.ts | ||
| campaignActionContext.unit.spec.ts | ||
| campaignAuthCookie.unit.spec.ts | ||
| campaignAuthMemoization.unit.spec.ts | ||
| campaignCellAutosave.unit.spec.ts | ||
| campaignCellEditOverlay.unit.spec.ts | ||
| campaignColumnPicker.unit.spec.ts | ||
| campaignColumnVisibility.unit.spec.ts | ||
| campaignComponents.unit.spec.ts | ||
| campaignCompositionCleanup.unit.spec.ts | ||
| campaignConsent.unit.spec.ts | ||
| campaignEntityListParsers.unit.spec.ts | ||
| campaignFormActions.unit.spec.ts | ||
| campaignGeolocation.unit.spec.ts | ||
| campaignIntelligenceConcepts.unit.spec.ts | ||
| campaignInviteArchitecture.unit.spec.ts | ||
| campaignInviteInteractions.unit.spec.ts | ||
| campaignInviteOrigin.unit.spec.ts | ||
| campaignJsonMutationRoute.unit.spec.ts | ||
| campaignListFilterNavigation.unit.spec.ts | ||
| campaignListUrl.unit.spec.ts | ||
| campaignLoginAction.unit.spec.ts | ||
| campaignMigrationSafety.unit.spec.ts | ||
| campaignPasswordSchemas.unit.spec.ts | ||
| campaignPwa.unit.spec.ts | ||
| campaignSearchInput.unit.spec.ts | ||
| campaignTable.unit.spec.ts | ||
| campaignUserProfile.unit.spec.ts | ||
| campoParties.unit.spec.ts | ||
| choroplethPercentScale.unit.spec.ts | ||
| codebaseConventions.unit.spec.ts | ||
| contactCityMigration.unit.spec.ts | ||
| dashboardPriorityMunicipalities.unit.spec.ts | ||
| electionPartySpectrum.unit.spec.ts | ||
| electionResults.unit.spec.ts | ||
| engagementLevel.unit.spec.ts | ||
| facebookPixel.unit.spec.ts | ||
| formatRelativeAge.unit.spec.ts | ||
| goalCoverage.unit.spec.ts | ||
| leadershipListUrl.unit.spec.ts | ||
| leadershipMunicipalityMembership.unit.spec.ts | ||
| leadershipStateDeputyRelationCell.unit.spec.ts | ||
| mapScaleClasses.unit.spec.ts | ||
| municipalityGeographyParts.unit.spec.ts | ||
| municipalityList.unit.spec.ts | ||
| municipalityMapNavigation.unit.spec.ts | ||
| municipalityPortfolio.unit.spec.ts | ||
| municipalityPortfolioCell.unit.spec.ts | ||
| municipalityPotential.unit.spec.ts | ||
| municipalityProximity.unit.spec.ts | ||
| municipalityStaffVoteTotal.unit.spec.ts | ||
| municipalityTerritorialClass.unit.spec.ts | ||
| municipalityVoteRank.unit.spec.ts | ||
| onda0ConsentTexts.unit.spec.ts | ||
| payloadAdminRoles.unit.spec.ts | ||
| projectionSheetParse.unit.spec.ts | ||
| recentVisits.unit.spec.ts | ||
| relationMembershipDelta.unit.spec.ts | ||
| revalidateRequest.unit.spec.ts | ||
| signatureExport.unit.spec.ts | ||
| siteMetadata.unit.spec.ts | ||
| stateDeputyListUrl.unit.spec.ts | ||
| supporterSchema.unit.spec.ts | ||
| supporterUi.unit.spec.ts | ||
| territoryAnchor.unit.spec.ts | ||
| territoryListUrl.unit.spec.ts | ||
| territoryOverview.unit.spec.ts | ||
| visitEligibility.unit.spec.ts | ||
| voteEstimate.unit.spec.ts | ||
| voteTrend.unit.spec.ts | ||