tangled
alpha
login
or
join now
karitham.dev
/
lazuli
0
fork
atom
like malachite (atproto-lastfm-importer) but in go and bluer
go
spotify
tealfm
lastfm
atproto
0
fork
atom
overview
issues
pulls
pipelines
atproto: fix broken applyWrites since refactor
karitham.dev
1 month ago
3cc2546c
c7ec171f
verified
This commit was signed with the committer's
known signature
.
karitham.dev
SSH Key Fingerprint:
SHA256:ODeRMGYuG7M/0G+fRF6IfwUk7r5AgG5MYdFTN+uvimc=
+14
-4
4 changed files
expand all
collapse all
unified
split
atproto
repo.go
repo_test.go
flake.nix
main.go
+5
-3
atproto/repo.go
···
184
184
if err := json.Unmarshal(b, &recMap); err != nil {
185
185
return nil, fmt.Errorf("failed to unmarshal record: %w", err)
186
186
}
187
187
-
recMap["$type"] = "com.atproto.repo.applyWrites#create"
188
188
-
recMap["collection"] = collection
189
189
-
writes[i] = recMap
187
187
+
writes[i] = map[string]any{
188
188
+
"$type": "com.atproto.repo.applyWrites#create",
189
189
+
"collection": collection,
190
190
+
"value": recMap,
191
191
+
}
190
192
}
191
193
192
194
return writes, nil
+7
atproto/repo_test.go
···
691
691
if w["collection"] != "app.bsky.feed.post" {
692
692
t.Errorf("write[%d] collection = %s, want app.bsky.feed.post", i, w["collection"])
693
693
}
694
694
+
if value, ok := w["value"].(map[string]any); !ok {
695
695
+
t.Errorf("write[%d] value should be a map, got %T", i, w["value"])
696
696
+
} else {
697
697
+
if value["text"] != "Hello" && value["text"] != "World" {
698
698
+
t.Errorf("write[%d] value text = %s, want Hello or World", i, value["text"])
699
699
+
}
700
700
+
}
694
701
}
695
702
},
696
703
},
+1
-1
flake.nix
···
17
17
let
18
18
lazuli = pkgs.buildGoModule rec {
19
19
name = "lazuli";
20
20
-
version = "0.1.5";
20
20
+
version = "0.1.6";
21
21
src = pkgs.nix-gitignore.gitignoreSource [ "*.csv" "*.zip" "*.json" ] ./.;
22
22
vendorHash = "sha256-O6R8jC8Ms5gsY2FUmuL8lTGTODfMW1CsSWuWbN27zeY=";
23
23
ldflags = [
+1
main.go
···
606
606
DryRun: dryRun,
607
607
ATProtoClient: repoClient,
608
608
ProgressLog: progressLog,
609
609
+
ClientAgent: fmt.Sprintf("lazuli/%s", Version),
609
610
Storage: a.storage,
610
611
Limiter: limiter,
611
612
}