Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and updates to the preferences API #1575

Merged
merged 4 commits into from
Sep 11, 2023
Merged

Fixes and updates to the preferences API #1575

merged 4 commits into from
Sep 11, 2023

Conversation

pfrazee
Copy link
Collaborator

@pfrazee pfrazee commented Sep 11, 2023

  • Guards against duplicate entries in preferences and ensures consistent reads of the state when setting and getting
  • Adds the "personal details" preference with the birth date that was recently added

@pfrazee pfrazee requested a review from dholms September 11, 2023 18:10
@pfrazee
Copy link
Collaborator Author

pfrazee commented Sep 11, 2023

Had to add a findLast() declaration. None of the es version targets that our tsconfig supports includes that, but support is pretty universal in the ES ecosystem (according to mdn; I also checked RN hermes) so I feel good w/this

Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks good 👍

one small thing: i'm not sure the order the preferences are returned is a part of the formal api contract - tho it is our our implementation does it (we explicitly order in the query)

that being said - this relieves the short term pain & fixing up the writes on the PDS should be the actual fix (and will work with either find or findLast)

@pfrazee
Copy link
Collaborator Author

pfrazee commented Sep 11, 2023

i'm not sure the order the preferences are returned is a part of the formal api contract - tho it is our our implementation does it (we explicitly order in the query)

Not a huge issue tbh. Duplicates are already an error case

@pfrazee pfrazee merged commit 4536967 into main Sep 11, 2023
10 checks passed
@pfrazee pfrazee deleted the pref-api-fixes branch September 11, 2023 20:23
@pfrazee
Copy link
Collaborator Author

pfrazee commented Sep 11, 2023

Published @atproto/[email protected]

estrattonbailey added a commit that referenced this pull request Sep 12, 2023
…Actor

* origin:
  Get rate limit ip correctly (#1577)
  Remove temp.upgradeRepoVersion (#1588)
  Fix getRepo `since` (#1579)
  Prevent user pref races (#1576)
  Feature: block lists (#1531)
  Enable appview proxy in dev-env full network (#1580)
  Increase timeline threshold (#1573)
  @atproto/[email protected]
  Fixes and updates to the preferences API (#1575)
  Remove legacy repo sync impl (#1570)
  Move fuzzy matcher to appview (#1566)
  @atproto/[email protected]
  Add personal-details user preference with birth date (#1565)
  enable granular perms for publish action (#1563)
  maintain feed order (#1559)
mloar pushed a commit to mloar/atproto that referenced this pull request Sep 26, 2023
* Fix to handle duplicate preference key entries

* Add personal details preference API to sdk

* Add Array.prototype.findLast() type declaration

* Move interface declaration to ensure it's included in other package builds
mloar pushed a commit to mloar/atproto that referenced this pull request Nov 15, 2023
* Fix to handle duplicate preference key entries

* Add personal details preference API to sdk

* Add Array.prototype.findLast() type declaration

* Move interface declaration to ensure it's included in other package builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants