Skip to content

Conversation

@eyeinsky
Copy link
Contributor

@eyeinsky eyeinsky commented Dec 16, 2025

WPB-21366: [Backend] Add type field to search contacts endpoint response

This PR adds the type field to contacts retrieved from GET /search/contacts. To achieve this it needs to send that field to Elastic Search as that's where the search happens. The challenge (sometimes) is in how to determine whether the user is an app or not, as that depends on whether there is an according row in the apps table for the user (i.e, it's a derived field and not a field on the user row).

Leaving this as draft, as there is still work outstanding:

  • comments marked with XXX, all these should be resolved before merging
  • adapt wire-subsystems' unit tests for the new field. Started adding State [StoredApp] there to the UserStore interpreter, as consulting the apps determines a user's type

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Dec 16, 2025
@eyeinsky eyeinsky force-pushed the ml/WPB-21366--add-type-field-to-search-contacts branch 2 times, most recently from fbd0b50 to c76d34c Compare December 19, 2025 16:57
@eyeinsky eyeinsky force-pushed the ml/WPB-21366--add-type-field-to-search-contacts branch 5 times, most recently from 5ec54b8 to 83fcf33 Compare December 31, 2025 11:25
@akshaymankar akshaymankar force-pushed the ml/WPB-21366--add-type-field-to-search-contacts branch 2 times, most recently from f5501ad to 38aa39c Compare January 5, 2026 13:37
@fisx fisx force-pushed the ml/WPB-21366--add-type-field-to-search-contacts branch from 38aa39c to ddac5ef Compare January 7, 2026 14:49
fisx added 2 commits January 8, 2026 13:10
There is prior art to this with email visibility and role, we're just
following the pattern. There might be a nicer way, though.
@fisx fisx force-pushed the ml/WPB-21366--add-type-field-to-search-contacts branch from ddac5ef to c79de27 Compare January 8, 2026 15:48
@fisx fisx force-pushed the ml/WPB-21366--add-type-field-to-search-contacts branch from fbf5490 to 3c4847b Compare January 8, 2026 15:52
fisx added 2 commits January 8, 2026 17:38
The code isn't a lot shorter this way, but there aren't two places
that make the same debatable decision to lie about user types of bots
before ES re-index.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants