feat: add Facebook Marketplace embeds - #99
Conversation
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
embedly-docs | 0e0b477 | Commit Preview URL Branch Preview URL |
Sep 07 2026, 05:55 AM |
Greptile SummaryAdds Facebook Marketplace URL support with listing details, photos, approximate-location maps, and per-Discord-user access control through PostHog.
Confidence Score: 5/5The new changes since the previous review appear safe to merge, though the existing non-blocking concern about silently discarded access-denied Marketplace matches remains outstanding. The post-review changes only introduce local aliases in Marketplace rendering and preserve existing behavior. The earlier unresolved finding remains: users denied Marketplace access receive no explicit access-related result because those matches are filtered out before response and update handling. Files Needing Attention: apps/bot/src/lib/handleUrls.ts
|
| Filename | Overview |
|---|---|
| apps/bot/src/lib/handleUrls.ts | Adds PostHog-based, fail-closed Marketplace access gating; the prior unresolved silent-denial behavior remains unchanged. |
| apps/bot/src/lib/builder.ts | Renders Marketplace-specific listing metadata and includes behavior-preserving cleanup since the previous review. |
| apps/bot/src/lib/client.ts | Initializes the optional PostHog client during login and shuts it down during client destruction. |
| packages/platforms/src/platforms/facebook-marketplace.ts | Matches, fetches, parses, and normalizes Facebook Marketplace listings, photos, prices, and approximate map data. |
Sequence Diagram
sequenceDiagram
participant U as Discord user
participant B as Embedly bot
participant P as PostHog
participant A as Embed API
participant F as Facebook Marketplace
U->>B: Submit Marketplace URL
B->>P: Evaluate facebook-marketplace flag
alt Access granted
B->>A: Request Marketplace embed
A->>F: Fetch listing page
F-->>A: Listing JSON and photos
A-->>B: Normalized listing
B-->>U: Marketplace embed
else Access denied or check unavailable
B-->>B: Remove Marketplace match
end
Reviews (3): Last reviewed commit: "fix(bot): preserve marketplace field nar..." | Re-trigger Greptile
| if (!hasAccess) { | ||
| matches = matches.filter((match) => match.platform !== "FacebookMarketplace"); | ||
| } |
There was a problem hiding this comment.
Denied matches disappear silently
When a user lacks Marketplace access, this filter removes the valid match without recording why. Message requests then receive no response, interactions incorrectly report that no platform matched, and message updates can leave the existing bot embed stale because its update target is skipped. Handle denied matches explicitly so users receive an access-related result and updates are not silently abandoned.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/bot/src/lib/handleUrls.ts
Line: 237-239
Comment:
**Denied matches disappear silently**
When a user lacks Marketplace access, this filter removes the valid match without recording why. Message requests then receive no response, interactions incorrectly report that no platform matched, and message updates can leave the existing bot embed stale because its update target is skipped. Handle denied matches explicitly so users receive an access-related result and updates are not silently abandoned.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
adds Facebook Marketplace embeds with price, photos, listing age, and an approximate location map. access is controlled per Discord user through PostHog.