mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 10:36:22 +08:00
feat(server): clean up dirty data from legacy version (#15078)
#### PR Dependency Tree * **PR #15078** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Persist and replay incoming payment webhooks for reliability. * Track provider-level subscriptions, payment events, and per-target trial usage across providers. * Nightly replay job to reprocess stuck payment events. * Shadow backfill mode and emit-suppression options to control projection/backfill side effects. * Subscriptions now derived from entitlements + provider facts. * **Bug Fixes** * Improved error propagation, retry tracking, and safer owner-grant projection handling. * **Tests** * Added webhook failure/replay, provider integration, entitlement projection, and trial/checkout tests. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
+6
-3
@@ -9,7 +9,7 @@ export class BackfillEntitlementProjection1765600000000 {
|
||||
const projection = ref.get(LegacyEntitlementProjectionService, {
|
||||
strict: false,
|
||||
});
|
||||
await projection.backfillEntitlementsAndQuotaStates();
|
||||
await projection.shadowBackfillEntitlementsAndQuotaStates();
|
||||
|
||||
const quota = ref.get(QuotaStateService, { strict: false });
|
||||
const [users, workspaces] = await Promise.all([
|
||||
@@ -18,9 +18,12 @@ export class BackfillEntitlementProjection1765600000000 {
|
||||
]);
|
||||
|
||||
const tasks = [
|
||||
...users.map(user => () => quota.reconcileUserQuotaState(user.id)),
|
||||
...users.map(
|
||||
user => () => quota.reconcileUserQuotaState(user.id, { emit: false })
|
||||
),
|
||||
...workspaces.map(
|
||||
workspace => () => quota.reconcileWorkspaceQuotaState(workspace.id)
|
||||
workspace => () =>
|
||||
quota.reconcileWorkspaceQuotaState(workspace.id, { emit: false })
|
||||
),
|
||||
];
|
||||
const batchSize = 16;
|
||||
|
||||
Reference in New Issue
Block a user