Handle URL string icons#774
Conversation
Parse URL string icon values as ActivityStreams Link values so callers do not dereference image files as JSON-LD documents. Fixes: fedify-dev#420 Assisted-by: OpenAI GPT-5:gpt-5
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR extends Fedify's ChangesIcon property Link and Image support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where URL strings in Activity Vocabulary icon values were incorrectly dereferenced as remote Image documents. The icon property range in object.yaml now includes Link, and the vocab-tools decoder has been updated to handle bare IDs as Link instances when appropriate. Additionally, the WebFinger implementation was updated to support these changes, and new tests were added to verify that string-based icons are correctly parsed as links without being dereferenced. I have no feedback to provide as there were no review comments.
Summary
iconURL strings to decode asLinkvalues instead of remoteImagedocument references.Image.urlandLink.hreficons.Fixes: #420
Verification
docker run --rm -v "$PWD":/workspace -w /workspace denoland/deno:2.7.13 deno task -f @fedify/vocab compiledocker run --rm -v "$PWD":/workspace -w /workspace/packages/vocab denoland/deno:2.7.13 deno test --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --filter "URL string icon" src/vocab.test.tsdocker run --rm -v "$PWD":/workspace -w /workspace/packages/vocab denoland/deno:2.7.13 deno test --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --filter "relative URLs" src/vocab.test.tsdocker run --rm -v "$PWD":/workspace -w /workspace/packages/fedify denoland/deno:2.7.13 deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks src/federation/webfinger.test.tsdocker run --rm -v "$PWD":/workspace -w /workspace/packages/vocab-tools denoland/deno:2.7.13 deno test -Anode --experimental-transform-types --test src/class.test.tsfrompackages/vocab-toolsbun test --timeout 15000 src/class.test.tsfrompackages/vocab-toolsdocker run --rm -v "$PWD":/workspace -w /workspace denoland/deno:2.7.13 deno fmt --check CHANGES.md packages/fedify/src/federation/webfinger.ts packages/vocab-tools/src/codec.ts packages/vocab-tools/src/property.ts packages/vocab/src/vocab.test.tsdocker run --rm -v "$PWD":/workspace -w /workspace denoland/deno:2.7.13 deno lint packages/fedify/src/federation/webfinger.ts packages/vocab-tools/src/codec.ts packages/vocab-tools/src/property.ts packages/vocab/src/vocab.test.tsdocker run --rm -v "$PWD":/workspace -w /workspace denoland/deno:2.7.13 deno check packages/fedify/src/federation/webfinger.ts packages/vocab-tools/src/codec.ts packages/vocab-tools/src/property.ts packages/vocab/src/vocab.test.tsgit diff --checkAI usage
This change and PR description were assisted by OpenAI GPT-5. The commit includes the required
Assisted-by: OpenAI GPT-5:gpt-5trailer.