Skip to content

fix(s3): parse S3 notification filter rules instead of failing on nested XML#180

Closed
mtpettyp wants to merge 1 commit intohectorvent:mainfrom
mtpettyp:mtpettyp/fix-s3-filter-parse
Closed

fix(s3): parse S3 notification filter rules instead of failing on nested XML#180
mtpettyp wants to merge 1 commit intohectorvent:mainfrom
mtpettyp:mtpettyp/fix-s3-filter-parse

Conversation

@mtpettyp
Copy link
Copy Markdown

@mtpettyp mtpettyp commented Apr 2, 2026

Summary

Fix XmlParser.extractGroupsMulti() and extractGroups() to handle nested elements like <Filter> instead of calling getElementText() which throws on non-text children. Add filterPrefix/filterSuffix fields to notification records and apply prefix/suffix matching in fireNotifications().

Closes #179

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

PutBucketNotificationConfiguration with <Filter><S3Key><FilterRule> elements was silently dropping the entire notification config. The config is now parsed correctly, persisted with prefix/suffix filters, serialized back in GetBucketNotificationConfiguration responses, and applied during event delivery.

Checklist

  • ./mvnw test passes locally
  • New or updated integration test added
  • Commit messages follow Conventional Commits

XmlParser.extractGroupsMulti() called getElementText() on every direct
child element, which throws on nested elements like <Filter>. The
exception was silently caught, causing the entire notification config
to be dropped.

Replace getElementText() with helpers that traverse nested elements and
extract <Name>/<Value> pairs from <FilterRule> blocks. Add filterPrefix
and filterSuffix fields to QueueNotification and TopicNotification
records, and apply prefix/suffix matching in fireNotifications().

Closes hectorvent#179

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mtpettyp mtpettyp changed the title fix: parse S3 notification filter rules instead of failing on nested XML fix(s3): parse S3 notification filter rules instead of failing on nested XML Apr 2, 2026
@mtpettyp
Copy link
Copy Markdown
Author

mtpettyp commented Apr 2, 2026

Looks like @fguery got his PR in before mine for #179 - see #178. Feel free to close this one if necessary.

@hectorvent
Copy link
Copy Markdown
Owner

Hi @mtpettyp thanks, I will take a look at of them.

Thank you again.

@hectorvent
Copy link
Copy Markdown
Owner

@mtpettyp Closing this one, thanks

@hectorvent hectorvent closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] S3 PutBucketNotificationConfiguration silently drops config when <Filter> element is present

2 participants