Skip to content

Commit fa04e99

Browse files
committed
chore: fix group-provision
1 parent 3bbcc9e commit fa04e99

File tree

1 file changed

+23
-1
lines changed
  • platforms/group-charter-manager-api/src/web3adapter/watchers

1 file changed

+23
-1
lines changed

platforms/group-charter-manager-api/src/web3adapter/watchers/subscriber.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,38 @@ export class PostgresSubscriber implements EntitySubscriberInterface {
180180
console.log("✅ Full entity loaded:", { id: fullEntity.id, tableName: event.metadata.tableName });
181181

182182
// Check if this is a Group entity and if charter was just added (not updated)
183+
console.log("🔍 Checking eVault conditions for entity:", {
184+
entityName,
185+
isGroup: entityName === "Group",
186+
hasCharter: !!fullEntity.charter,
187+
charterContent: fullEntity.charter,
188+
charterTrimmed: fullEntity.charter ? fullEntity.charter.trim() : null,
189+
charterNotEmpty: fullEntity.charter ? fullEntity.charter.trim() !== "" : false,
190+
hasEname: !!fullEntity.ename,
191+
enameValue: fullEntity.ename
192+
});
193+
183194
if (entityName === "Group" && fullEntity.charter && fullEntity.charter.trim() !== "") {
195+
console.log("✅ Group entity with charter detected");
196+
184197
// Check if this group doesn't have an ename yet (meaning eVault wasn't created)
185198
if (!fullEntity.ename) {
186-
console.log("Group just got chartered, spinning up eVault for group:", fullEntity.id);
199+
console.log("🎯 eVault creation conditions met! Group:", fullEntity.id, "needs eVault");
187200

188201
// Fire and forget eVault creation
189202
this.spinUpGroupEVault(fullEntity).catch(error => {
190203
console.error("Failed to create eVault for group:", fullEntity.id, error);
191204
});
205+
} else {
206+
console.log("⚠️ Group already has ename, skipping eVault creation:", fullEntity.ename);
192207
}
208+
} else {
209+
console.log("❌ eVault conditions not met:", {
210+
isGroup: entityName === "Group",
211+
hasCharter: !!fullEntity.charter,
212+
charterNotEmpty: fullEntity.charter ? fullEntity.charter.trim() !== "" : false,
213+
hasEname: !!fullEntity.ename
214+
});
193215
}
194216

195217
entity = (await this.enrichEntity(

0 commit comments

Comments
 (0)