Merge pull request #6150 from urbit/philip/contact-fix

contact-store: no-op if adding old contact
This commit is contained in:
Hunter Miller 2022-12-12 14:28:52 -06:00 committed by GitHub
commit 36deb95411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3306a5b916caa838c67cb079410c6e5bb158054520129ffb9f9bdb144ab1b691
size 7418493
oid sha256:ea8626444e4f0213e39c21ded20607145ee85a947afc592f182f46e7f598ef30
size 7748671

View File

@ -123,7 +123,15 @@
:: ensure difference
=/ old=(unit contact:store) (~(get by rolodex) ship)
?. ?| ?=(~ old)
!=(contact(last-updated *@da) u.old(last-updated *@da))
:: if new contact is before existing contact, no-op
::
:: NB: last-updated.contact is often *@da, so this
:: effectively stops add from applying if we already have
:: a contact for them
::
?& (gth last-updated.contact last-updated.u.old)
!=(contact(last-updated *@da) u.old(last-updated *@da))
==
==
[~ state]
~| "cannot add a data url to cover!"