Skip to content

Commit 7c471b7

Browse files
authored
fix: emover batches (#773)
1 parent b65c9e8 commit 7c471b7

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

platforms/emover-api/src/controllers/MigrationController.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ export class MigrationController {
171171
});
172172
}
173173

174-
await this.processMigration(migrationId);
174+
// Fire and forget - don't block eID wallet UI
175+
this.processMigration(migrationId).catch((error) => {
176+
console.error(`Migration ${migrationId} failed:`, error);
177+
});
175178

176179
return res.status(200).json({
177180
success: true,

platforms/emover-api/src/services/MigrationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export class MigrationService extends EventEmitter {
414414
migration: Migration,
415415
): Promise<number> {
416416
const graphqlUrl = new URL("/graphql", newEvaultUri).toString();
417-
const batchSize = 50; // Process in batches to avoid timeout
417+
const batchSize = 10; // Process in batches to avoid 413 payload too large
418418
let totalCreated = 0;
419419

420420
const mutation = `

platforms/emover-api/src/services/SigningService.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ export class SigningService extends EventEmitter {
7676
return { success: false, error: "Session expired" };
7777
}
7878

79+
// Verify signer's w3id matches the migration owner's eName
80+
const expectedEName = session.data.eName as string;
81+
if (w3id !== expectedEName) {
82+
return {
83+
success: false,
84+
error: `Signer w3id (${w3id}) does not match migration owner (${expectedEName})`,
85+
};
86+
}
87+
7988
// Verify signature (simplified - in production, use proper signature verification)
8089
// For now, we'll just check that signature exists
8190
if (!signature) {

0 commit comments

Comments
 (0)