Gotchas: hbf-knowledge-manager
Package-specific non-obvious patterns and pitfalls. Loaded on demand when working on this package.
- SharePointDeltaService lives in WebhooksModule: To avoid a circular NestJS module dependency (SharePointModule -> SyncModule -> SourcesModule -> SharePointModule),
SharePointDeltaServiceis declared as a provider inWebhooksModule, notSharePointModule. The file still lives atsrc/sources/sharepoint/sharepoint-delta.service.ts. - Graph webhook notifications don't contain file events: Unlike Azure Event Grid (which sends BlobCreated/BlobDeleted with metadata), SharePoint Graph webhooks only say "something changed". A delta query follow-up is always required. The
SharePointWebhookHandler.parseEvent()returns null by design.
Content Type Filtering
allowedContentTypesholds file extensions, not MIME types: Both Azure Blob and SharePoint integrations use extension-based filtering (e.g.,["pdf", "docx"]). TheisAllowedFileTypefunction checks the file extension, not the content-type header. Old integrations may still have MIME values needing migration.- Azure Blob full-sync and webhook paths must apply the same filters: If they diverge, webhooks create groups that full-sync's orphan cleanup deletes (orphan cleanup only runs when
errors.length === 0).