mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
refactor(OH6): reuse OH2 resolveOpsHybridEnabled
Drop the temporary opsSync flag helper now that lib/campaignOps landed on main; keep next.config env inlining for the client island.
This commit is contained in:
parent
a78170c4f9
commit
5f0943bff3
3 changed files with 1 additions and 24 deletions
|
|
@ -13,7 +13,7 @@ Responsável: —
|
|||
## Freshness audit (2026-08-01)
|
||||
|
||||
- OH1 (#164) `done`/`in-prod`. Paths e assinaturas (`estimateVotesRecord`, `PledgeEstimateForm`, `estimateVotesSchema`, `estimatedAt` no hook) batem.
|
||||
- `OPS_HYBRID` / `lib/campaignOps` ainda não existem (OH2 #163 in-progress em paralelo) — OH6 lê `OPS_HYBRID` via `next.config` `env` + helper local em `opsSync/` (sem abrir o pacote OH2).
|
||||
- OH2 (#163) mergeou durante a entrega — OH6 reusa `resolveOpsHybridEnabled` de `lib/campaignOps/opsHybridFlag.ts` + `OPS_HYBRID` via `next.config` `env`.
|
||||
- `@tanstack/offline-transactions@1.0.42` exige collection TanStack DB — tracer usa `localOnlyCollectionOptions` (OH7 troca pelo mirror).
|
||||
|
||||
## Premissas
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
/**
|
||||
* OH6 tracer — compile-time `OPS_HYBRID` reader for the estimate outbox island.
|
||||
* OH2 owns the canonical `src/lib/campaignOps/opsHybridFlag.ts`; this local
|
||||
* helper avoids opening that package while OH2 lands in parallel.
|
||||
*/
|
||||
export const resolveOpsHybridEnabled = (
|
||||
env: NodeJS.ProcessEnv | Record<string, string | undefined> = process.env,
|
||||
): boolean => {
|
||||
const raw = env.OPS_HYBRID?.trim().toLowerCase()
|
||||
return raw === '1' || raw === 'true'
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ import {
|
|||
resolveEstimateTransactionPledgeKey,
|
||||
toOpsEstimateOutboxRow,
|
||||
} from '@/components/campaign/opsSync/opsEstimateOutboxModel'
|
||||
import { resolveOpsHybridEnabled } from '@/components/campaign/opsSync/opsHybridEnabled'
|
||||
import type { OfflineTransaction } from '@tanstack/offline-transactions'
|
||||
|
||||
const tx = (id: string, pledgeId: number, createdAtMs: number): OfflineTransaction =>
|
||||
|
|
@ -52,14 +51,3 @@ describe('opsEstimateOutboxModel (OH6)', () => {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('resolveOpsHybridEnabled (OH6)', () => {
|
||||
it('accepts 1/true and rejects absent/other values', () => {
|
||||
expect(resolveOpsHybridEnabled({ OPS_HYBRID: '1' })).toBe(true)
|
||||
expect(resolveOpsHybridEnabled({ OPS_HYBRID: 'true' })).toBe(true)
|
||||
expect(resolveOpsHybridEnabled({ OPS_HYBRID: 'TRUE' })).toBe(true)
|
||||
expect(resolveOpsHybridEnabled({ OPS_HYBRID: '0' })).toBe(false)
|
||||
expect(resolveOpsHybridEnabled({ OPS_HYBRID: '' })).toBe(false)
|
||||
expect(resolveOpsHybridEnabled({})).toBe(false)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue