feat: extract structured data from notifications#617
Merged
Conversation
|
|
a9434f5 to
5a6ce55
Compare
…it tests - Cache extractStructuredData result instead of calling twice per notification - Replace unsafe double-cast (as unknown as LinkedInNotification) with properly typed object - Remove dead notification_category filter condition from isMatch() - Add module-level _extractNotificationStructuredData export for testing - Add --types option to CLI notifications list command for parity with MCP - Add 18 unit tests covering all 9 regex parsers and edge cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens the notification extraction feature to production quality by fixing type safety issues, eliminating redundant work, removing dead code, adding CLI parity, and adding comprehensive unit test coverage.
Closes #613
Changes
Type Safety & Performance (
linkedinNotifications.ts)extractStructuredData(message)was called twice per notification (once for truthiness check, once for value). Now cached in a local variable.Record<string, unknown>+as unknown as LinkedInNotificationdouble-cast with a properly typedLinkedInNotificationobject built directly.isMatch()function checkedn.extracted_data.notification_categorybutextractStructuredData()never sets that field. Removed the dead code path._extractNotificationStructuredData()mirror function following the existing_-prefix testing export convention (Playwright constraint: browser-evaluated functions must be self-contained, so the inline copy remains).CLI Parity (
cli/src/bin/linkedin.ts)--types <types...>(-t) variadic option tonotifications listcommand, matching the existing MCP tool parameter.Test Coverage (
__tests__/linkedinNotifications.test.ts)Verification