fix(relay): wire custom filter fields through HTTP bridge#864
Merged
Conversation
POST /query deserializes into nostr::Filter which silently drops non-NIP-01 fields. The CLI (PR #850) injects before_id, depth_limit, and feed_types — all three vanish at the bridge layer while the DB already supports them. Two-pass parse extracts custom fields from raw JSON before standard deserialization. Routing: before_id populates EventQuery for keyset pagination, depth_limit dispatches to get_thread_replies, feed_types dispatches to the dedicated feed query functions.
Return 400 when before_id is sent without until instead of silently dropping it. Add handled-index guard to depth_limit loop to prevent double-processing. Extract event_in_accessible_channel helper to replace three inline copies. Normalize agent_activity to activity to avoid duplicate DB queries, enforce aggregate feed limit across types, replace magic numbers with named constants, and add unit tests for all extractor functions.
70f042e to
400df8b
Compare
michaelneale
added a commit
that referenced
this pull request
Jun 6, 2026
* origin/main: chore(release): release version 0.3.12 (#886) Show hover cards for inline message emoji (#885) Fix monotonic read-state merges (#884) Refine sidebar behavior and borders (#869) fix(presence): clear on disconnect, fix heartbeat/TTL, drop broken REST path (#877) fix(cli): publish ephemeral events over WebSocket via sprout-ws-client (#876) docs(sprout-acp): add communication discipline rules to base prompt + deprecate --mention flag (#883) Polish thread summaries and reactions (#881) feat(cli): add emoji export and import subcommands (#882) Polish message row hover states (#880) Improve emoji naming and custom emoji UX (#878) docs: add ecosystem section to CONTRIBUTING.md, fix stale release info (#873) fix(relay): wire custom filter fields through HTTP bridge (#864) chore: deprecate sprout-mcp — fill CLI gaps, remove crate and all references (#850) Fix custom emoji status in profile popover (#874) fix(agent): gate handoff on provider token usage, not byte estimate (#821) docs: add VISION_MESH.md — the compute-commons vision (#867) fix(desktop): simplify profile popover header (#853) fix(desktop): remove thread comment hover outline (#861) feat(desktop): always show channel section search/add buttons (#856) # Conflicts: # crates/sprout-cli/src/client.rs # desktop/src/app/AppShell.tsx # justfile
tellaho
pushed a commit
that referenced
this pull request
Jun 8, 2026
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
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
POST /querydeserializes intonostr::Filter(external crate) which silently drops non-NIP-01 fields. The CLI (#850) injectsbefore_id,depth_limit, andfeed_typesinto filter JSON — all three vanish at the bridge layer while the DB already supports them.Vec<Value>first to extract custom fields, then convert toVec<nostr::Filter>for standard processing.before_id→ populatesEventQuery.before_idfor composite keyset pagination; returns 400 ifuntilis not also setdepth_limit→ dispatches toget_thread_replies(thread_metadata table) instead ofquery_events, then batch-fetches full events by IDfeed_types→ dispatches to dedicated feed query functions (query_feed_mentions,query_feed_needs_action,query_feed_activity); normalizesagent_activitytoactivity; enforces aggregate limit across typesHashSet<usize>tracks which filter indices were handled by intercepts so the standard loop skips themevent_in_accessible_channelhelper extracts the repeated channel access post-filter patternBRIDGE_FEED_MAX_LIMIT/BRIDGE_THREAD_MAX_LIMITreplace inline magic numbersRelated: #850 (CLI flags that send these fields)