feat(imports): Access Pass products through the importer's signed-in account
IMVU hides Access Pass products from the signed out, so the hub learns about them from the importer: a "list" job has it list a whole shop signed in (queued with each listing once its importer has an account that signed in with Access Pass), and a job's product the hub can't see is looked up by the importer first (/info). The console no longer says an account has no Access Pass when IMVU merely doesn't show it publicly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
56d25f7507
commit
e2308aa0aa
12 files changed
+4865
-51
No files matched your search
@@ -0,0 +1,4 @@
|
||||
DROP INDEX "import_job_open";--> statement-breakpoint
|
||||
ALTER TABLE "import_grant" ADD COLUMN "shop_listed_signed_in" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX "import_job_list_open" ON "import_job" USING btree ("catalog_id","imvu_product") WHERE "import_job"."status" in ('queued', 'claimed') and "import_job"."kind" = 'list';--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX "import_job_open" ON "import_job" USING btree ("catalog_id","imvu_product") WHERE "import_job"."status" in ('queued', 'claimed') and "import_job"."kind" <> 'list';
|
||||
File diff suppressed because it is too large.
Load diff
@@ -141,6 +141,13 @@
|
||||
"when": 1794092472616,
|
||||
"tag": "0019_shop_listing",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 20,
|
||||
"version": "7",
|
||||
"when": 1794150630963,
|
||||
"tag": "0020_importer_signed_in",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -757,6 +757,7 @@ export const importGrant = pgTable(
|
||||
// IMVU lists no Access Pass products to the signed out).
|
||||
shopListedAt: timestamp("shop_listed_at", { withTimezone: true }),
|
||||
shopListed: integer("shop_listed").notNull().default(0),
|
||||
shopListedSignedIn: boolean("shop_listed_signed_in").notNull().default(false), // by the importer, signed in: AP products too
|
||||
// "pending" (the catalog's team hasn't accepted), "active", "declined", "suspended", "withdrawn".
|
||||
status: text("status").notNull().default("pending"),
|
||||
statusReason: text("status_reason").notNull().default(""),
|
||||
@@ -799,7 +800,7 @@ export const importJob = pgTable(
|
||||
.notNull()
|
||||
.references(() => importGrant.id, { onDelete: "cascade" }),
|
||||
imvuProduct: bigint("imvu_product", { mode: "number" }).notNull(),
|
||||
kind: text("kind").notNull(), // "import", "recheck"
|
||||
kind: text("kind").notNull(), // "import", "recheck", "list" (a whole shop, signed in: imvuProduct is the creator's IMVU ID)
|
||||
status: text("status").notNull().default("queued"), // "queued", "claimed", "done", "failed"
|
||||
imvuRevision: integer("imvu_revision"), // done: the revision imported (or found unchanged)
|
||||
reason: text("reason").notNull().default(""), // why it failed (last attempt)
|
||||
@@ -811,10 +812,13 @@ export const importJob = pgTable(
|
||||
},
|
||||
(t) => [
|
||||
index("import_job_queue").on(t.catalogId, t.status, t.nextAt),
|
||||
// One open job per product and catalog.
|
||||
// One open job per product and catalog, and one open listing per shop and catalog.
|
||||
uniqueIndex("import_job_open")
|
||||
.on(t.catalogId, t.imvuProduct)
|
||||
.where(sql`${t.status} in ('queued', 'claimed')`),
|
||||
.where(sql`${t.status} in ('queued', 'claimed') and ${t.kind} <> 'list'`),
|
||||
uniqueIndex("import_job_list_open")
|
||||
.on(t.catalogId, t.imvuProduct)
|
||||
.where(sql`${t.status} in ('queued', 'claimed') and ${t.kind} = 'list'`),
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user