Enforced Zoned Attribute Lookups #394
No reviewers
Labels
No Label
applications
BLOCKED
bug
design
duplicate
enhancement
fixed?
funding-needed
help wanted
infrastructure
invalid
payments
qubes
question
ready-for-implementation
refactor
spam
tapir-server
testing
tor
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cwtch.im/cwtch#394
Loading…
Reference in New Issue
No description provided.
Delete Branch "zoned_attributes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/404
we need to consider migrating things somewhere like manually set group and contact names, do we want to think about it here in storage? we store a storage version number, we could move to version 2 (without having to even dup a v2, just an informal 2) but it would trigger a migration script to copy those attributes).
or
we could make it libcwtch-go's job as a one time migration. thoughts? one should handle it so we don't drop user settings
@ -51,4 +64,0 @@
}
// GetScopePath take a full path and returns the scope and the scope-less path
func GetScopePath(fullPath string) (string, string) {
why did we drop a function to peel off the scope and return a zonedPath or scope, zone and path?
This basically became ParseZone. Practically we never pass scope and path together in a single string in a way that needs splitting like this.
@ -35,1 +32,3 @@
return PublicScope + Separator + path
// IntoScope converts a string to a Scope
func IntoScope(scope string) Scope {
return Scope(scope)
force into one of approved scopes or error? or else into "unknown-garbage" scope?
@ -36,0 +35,4 @@
}
// ConstructScopedZonedPath enforces a scope over a zoned path
func (scope Scope) ConstructScopedZonedPath(zonedPath ZonedPath) string {
if we're going type heavy dont we want it to return a like ScopedZonedPath?
@ -41,0 +48,4 @@
func (scope Scope) IsConversation() bool {
return scope == ConversationScope
}
IsLocal() bool ?
@ -0,0 +27,4 @@
// EnforceZone takes a path and attaches a zone to it.
// Note that this returns a ZonedPath which isn't directly usable, it must be given to ConstructScopedZonedPath
// in order to be realized into an actual attribute path.
func (zone Zone) EnforceZone(path string) ZonedPath {
why constuct for scope but enforce for zone?
@ -168,2 +204,4 @@
SendScopedZonedGetValToContact(handle string, scope attr.Scope, zone attr.Zone, key string)
// Deprecated
SendMessageToPeer(string, string) string
this looks like it has lots of use? we want to create a issue to start on that?
Created: #395
@ -170,3 +208,4 @@
// TODO This should probably not be exposed
// Deprecated do not use this to store messages
StoreMessage(onion string, messageTxt string, sent time.Time)
What is still using this?
case event.NewMessageFromPeer:
is but it can at least be dropped from the interface than as that's internal only. it looks like libcwtch-go doesn't use it. so i think it can be droped from the interface?@dan RE: migration - this change is backwards compatible with the exception of the file sharing experiment (which, because we don't have resumption completed yet means any attributes saved are effectively meaningless anyway)
I do want to eventually move attributes like name and tag over to proper zones, but I think that can be done in a separate PR.
WIP: Enforced Zoned Attribute Lookupsto Enforced Zoned Attribute LookupsDrone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/406