@@ -180,16 +180,38 @@ export class PostgresSubscriber implements EntitySubscriberInterface {
180
180
console . log ( "✅ Full entity loaded:" , { id : fullEntity . id , tableName : event . metadata . tableName } ) ;
181
181
182
182
// 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
+
183
194
if ( entityName === "Group" && fullEntity . charter && fullEntity . charter . trim ( ) !== "" ) {
195
+ console . log ( "✅ Group entity with charter detected" ) ;
196
+
184
197
// Check if this group doesn't have an ename yet (meaning eVault wasn't created)
185
198
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" ) ;
187
200
188
201
// Fire and forget eVault creation
189
202
this . spinUpGroupEVault ( fullEntity ) . catch ( error => {
190
203
console . error ( "Failed to create eVault for group:" , fullEntity . id , error ) ;
191
204
} ) ;
205
+ } else {
206
+ console . log ( "⚠️ Group already has ename, skipping eVault creation:" , fullEntity . ename ) ;
192
207
}
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
+ } ) ;
193
215
}
194
216
195
217
entity = ( await this . enrichEntity (
0 commit comments