Fix notion-sync header crash on non-ASCII titles #48

Merged
amoussa1229 merged 1 commit from fix/notion-sync-metadata-encoding into main 2026-06-08 19:42:41 +00:00
amoussa1229 commented 2026-06-08 19:05:15 +00:00 (Migrated from github.com)

What

notion-sync failed on every page whose Notion title contained non-ASCII characters (e.g. em-dash U+2014): setting the S3 object metadata header x-amz-meta-notion-title from the raw title threw ERR_INVALID_CHAR because HTTP headers must be Latin-1/ASCII.

Changes

  • Add sanitizeMetadataValue() to strip non-ASCII before setting S3 metadata.
  • Treat Bedrock ConflictException (ingestion already running) as benign.

Status

Deploy-before-merge: already deployed to the seahaven-slack-bot stack (UPDATE_COMPLETE). Post-deploy run verified 78 synced, 0 failed and started KB ingestion job 3FLTCZHB63. tsc --noEmit clean.

Closes the AWS audit H-9 seahaven-notion-sync finding (Day-2 remediation, report §1.6).

## What `notion-sync` failed on every page whose Notion title contained non-ASCII characters (e.g. em-dash U+2014): setting the S3 object metadata header `x-amz-meta-notion-title` from the raw title threw `ERR_INVALID_CHAR` because HTTP headers must be Latin-1/ASCII. ## Changes - Add `sanitizeMetadataValue()` to strip non-ASCII before setting S3 metadata. - Treat Bedrock `ConflictException` (ingestion already running) as benign. ## Status Deploy-before-merge: already deployed to the `seahaven-slack-bot` stack (UPDATE_COMPLETE). Post-deploy run verified **78 synced, 0 failed** and started KB ingestion job `3FLTCZHB63`. `tsc --noEmit` clean. Closes the AWS audit H-9 `seahaven-notion-sync` finding (Day-2 remediation, report §1.6).
This repo is archived. You cannot comment on pull requests.
No description provided.