Page MenuHomePhabricator

[keyserver] add viewer acknowledgment fetcher
ClosedPublic

Authored by kamil on Dec 6 2022, 6:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 7:03 AM
Unknown Object (File)
Sat, Nov 9, 7:03 AM
Unknown Object (File)
Fri, Nov 8, 9:59 AM
Unknown Object (File)
Mon, Oct 28, 7:56 AM
Unknown Object (File)
Sep 28 2024, 1:34 PM
Unknown Object (File)
Sep 28 2024, 1:34 PM
Unknown Object (File)
Sep 28 2024, 1:34 PM
Unknown Object (File)
Sep 28 2024, 1:34 PM
Subscribers

Details

Summary

Function fetches viewer policies with confirmed value

Test Plan

Check if returns proper value for one/multiple policies

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Dec 6 2022, 6:55 AM
tomek requested changes to this revision.Dec 6 2022, 9:23 AM
tomek added inline comments.
keyserver/src/fetchers/policy-acknowledgment-fetchers.js
13 ↗(On Diff #19175)

Do we have an index that will help us selecting it?

13–15 ↗(On Diff #19175)

Why do we call append multiple times? I think it would be better to just have a multiline string. The only thing that needs append is mergeOrConditions.

16 ↗(On Diff #19175)

Instead of using OR we can have IN condition. Usually IN is more readable and faster (might depend on the exact use case, db engine, etc.)

lib/types/policy-types.js
5–8 ↗(On Diff #19175)

We should use readonly where possible. Also the name is singular so it isn't a good idea to make a type an array.

This revision now requires changes to proceed.Dec 6 2022, 9:23 AM

improve query, make types read-only

keyserver/src/fetchers/policy-acknowledgment-fetchers.js
13 ↗(On Diff #19175)

we have a primary key consisting user and policy columns so I think it should be okay

16 ↗(On Diff #19175)

Good point, I missed that, thanks!

This revision is now accepted and ready to land.Dec 13 2022, 5:26 AM