Allow Peers to Store History #316

Злито
dan злито 1 комітів з peer_history до master 2020-07-08 22:32:48 +00:00
sarah прокоментував(ла) 2020-07-08 18:30:53 +00:00
Власник
No description provided.
dan був призначений sarah 2020-07-08 18:30:53 +00:00
buildbot прокоментував(ла) 2020-07-08 18:38:18 +00:00
Учасник
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/769
buildbot прокоментував(ла) 2020-07-08 19:41:31 +00:00
Учасник
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/771
dan зробив запит змін 2020-07-08 19:52:58 +00:00
storage/v1/profile_store.go Застарілі
@ -258,6 +260,10 @@ func (ps *ProfileStoreV1) load() error {
contact.Authorization = model.AuthApproved
}
}
dan прокоментував(ла) 2020-07-08 19:45:59 +00:00
Власник

like above, prolly better to check at load if the attribute is set or not and set it accordingly instead of the double initializer for it you have in the event handler below. Also since this is a required attribute, should also be added to cwtchPeer.AddContact, line 194 has the attributes being initialized.

then we can create a stream store only where needed, then the event handler can just reach for the stream store and if there is one, use it, if not, not use it, simplifying that code a bunch in the event handler

BUT it does mean then doing processing of the SavePeerHistory event and creating or deleting stream stores there.
but that's actually good as right now we don't capture that, so we never delete history when its changed? which means when someone turns it off, the existing history sits there, forever being loaded, but never updated, which isn't great, so that event does need handling regardless

also prolly want a ps.save after the loop to capture and save any new defaults added

like above, prolly better to check at load if the attribute is set or not and set it accordingly instead of the double initializer for it you have in the event handler below. Also since this is a required attribute, should also be added to cwtchPeer.AddContact, line 194 has the attributes being initialized. then we can create a stream store only where needed, then the event handler can just reach for the stream store and if there is one, use it, if not, not use it, simplifying that code a bunch in the event handler BUT it does mean then doing processing of the SavePeerHistory event and creating or deleting stream stores there. but that's actually good as right now we don't capture that, so we never delete history when its changed? which means when someone turns it off, the existing history sits there, forever being loaded, but never updated, which isn't great, so that event does need handling regardless also prolly want a ps.save after the loop to capture and save any new defaults added
storage/v1/profile_store.go Застарілі
@ -346,0 +368,4 @@
ss.Write(message)
}
}
case event.DontSaveHistoryDefault:
dan прокоментував(ла) 2020-07-08 19:46:29 +00:00
Власник

very rust of you? :P
but we can just have hte one empty default

very rust of you? :P but we can just have hte one empty default
storage/v1/profile_store.go Застарілі
@ -346,0 +376,4 @@
}
}
}
ps.save()
dan прокоментував(ла) 2020-07-08 19:48:03 +00:00
Власник

shouldn't need this if we aren't setting a default here

shouldn't need this if we aren't setting a default here
storage/v1/profile_store.go Застарілі
@ -346,0 +382,4 @@
}
case event.NewMessageFromPeer:
contact, exists := ps.profile.GetContact(ev.Data[event.RemotePeer])
if exists {
dan прокоментував(ла) 2020-07-08 19:49:30 +00:00
Власник

also this is copy/pasted, should be pulled out into a function instead

also this is copy/pasted, should be pulled out into a function instead
sarah попросив рецензію від dan 2020-07-08 20:26:56 +00:00
buildbot прокоментував(ла) 2020-07-08 20:33:34 +00:00
Учасник
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/773
buildbot прокоментував(ла) 2020-07-08 21:12:05 +00:00
Учасник
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/775
sarah змінився заголовок з WIP: Allow Peers to Store History на Allow Peers to Store History 2020-07-08 21:33:08 +00:00
buildbot прокоментував(ла) 2020-07-08 22:32:24 +00:00
Учасник
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/777
dan merged commit 2c13feb71e into master 2020-07-08 22:32:48 +00:00
Підпишіться щоб приєднатися до обговорення.
Немає рецензентів
dan
Етап відсутній
Немає виконавця
3 учасників
Сповіщення
Дата завершення
Термін дії не дійсний або знаходиться за межами допустимого діапазону. Будь ласка використовуйте формат 'yyyy-mm-dd'.

Термін виконання не встановлений.

Залежності

No dependencies set.

Reference: cwtch.im/cwtch#316
No description provided.