alpha
Login
or
Join now
microcosm.blue
/
microcosm-rs
Star
0
Fork
3
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
Star
0
Fork
3
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
almost testing something. almost.
author
phil
date
1 year ago
(Apr 5, 2025, 11:56 PM -0400)
commit
a437b994
a437b9945497c0da0ebca9c6a61f00373d67ef99
parent
52ff3eaa
52ff3eaa83b8e4842baa2b2441df34211664ed2f
+48
-7
3 changed files
Expand all
Collapse all
Unified
Split
Cargo.lock
jetstream
Cargo.toml
ufos
src
storage_fjall.rs
+6
-6
Cargo.lock
Reviewed
···
219
219
220
220
[[package]]
221
221
name = "atrium-api"
222
222
-
version = "0.25.0"
222
222
+
version = "0.25.2"
223
223
source = "registry+https://github.com/rust-lang/crates.io-index"
224
224
-
checksum = "ea3ea578c768ec91082e424a8d139517b2cb5c75149bf3cec04371a1e74f00f2"
224
224
+
checksum = "0d4eb9b4787aba546015c8ccda1d3924c157cee13d67848997fba74ac8144a07"
225
225
dependencies = [
226
226
"atrium-common",
227
227
"atrium-xrpc",
···
239
239
240
240
[[package]]
241
241
name = "atrium-common"
242
242
-
version = "0.1.0"
242
242
+
version = "0.1.1"
243
243
source = "registry+https://github.com/rust-lang/crates.io-index"
244
244
-
checksum = "168e558408847bfed69df1033a32fd051f7a037ebc90ea46e588ccb2bfbd7233"
244
244
+
checksum = "ba30d2f9e1a8b3db8fc97d0a5f91ee5a28f8acdddb771ad74c1b08eda357ca3d"
245
245
dependencies = [
246
246
"dashmap",
247
247
"lru",
···
254
254
255
255
[[package]]
256
256
name = "atrium-xrpc"
257
257
-
version = "0.12.1"
257
257
+
version = "0.12.2"
258
258
source = "registry+https://github.com/rust-lang/crates.io-index"
259
259
-
checksum = "6b4956d94147cfbb669c68f654eb4fd6a1d00648c810cec79d04ec5425b8f378"
259
259
+
checksum = "18a9e526cb2ed3e0a2ca78c3ce2a943d9041a68e067dadf42923b523771e07df"
260
260
dependencies = [
261
261
"http",
262
262
"serde",
+1
-1
jetstream/Cargo.toml
Reviewed
···
10
10
11
11
[dependencies]
12
12
async-trait = "0.1.83"
13
13
-
atrium-api = { version = "0.25", default-features = false, features = [
13
13
+
atrium-api = { version = "0.25.2", default-features = false, features = [
14
14
"namespace-appbsky",
15
15
] }
16
16
tokio = { version = "1.41.1", features = ["full", "sync", "time"] }
+41
ufos/src/storage_fjall.rs
Reviewed
···
1112
1112
1113
1113
#[cfg(test)]
1114
1114
mod tests {
1115
1115
+
use jetstream::exports::Cid;
1116
1116
+
use jetstream::events::{CommitEvent, CommitOp};
1117
1117
+
use serde_json::value::RawValue;
1118
1118
+
use crate::{UFOsCommit, CollectionCommits};
1115
1119
use super::*;
1116
1120
1117
1121
#[test]
···
1125
1129
)?;
1126
1130
1127
1131
write.insert_batch(EventBatch {
1132
1132
+
..Default::default()
1133
1133
+
})?;
1134
1134
+
1135
1135
+
Ok(())
1136
1136
+
}
1137
1137
+
1138
1138
+
#[test]
1139
1139
+
fn test_insert_one() -> anyhow::Result<()> {
1140
1140
+
// let db_path = tempfile::tempdir()?;
1141
1141
+
let (_read, mut write, _) = FjallStorage::init(
1142
1142
+
tempfile::tempdir()?,
1143
1143
+
"offline test (no real jetstream endpoint)".to_string(),
1144
1144
+
false,
1145
1145
+
FjallConfig { temp: true },
1146
1146
+
)?;
1147
1147
+
1148
1148
+
let did = Did::new("did:plc:inze6wrmsm7pjl7yta3oig77".to_string()).unwrap();
1149
1149
+
let event = CommitEvent {
1150
1150
+
collection: Nsid::new("a.b.c".to_string()).unwrap(),
1151
1151
+
rkey: RecordKey::new("asdf".to_string()).unwrap(),
1152
1152
+
rev: "asdf".to_string(),
1153
1153
+
operation: CommitOp::Create,
1154
1154
+
record: Some(*Box::new(RawValue::from_string("{}".to_string()).unwrap())),
1155
1155
+
cid: Some("bafyreidofvwoqvd2cnzbun6dkzgfucxh57tirf3ohhde7lsvh4fu3jehgy".parse().unwrap()),
1156
1156
+
};
1157
1157
+
let (commit, collection) = UFOsCommit::from_commit_info(event, did.clone(), Cursor::from_raw_u64(100))?;
1158
1158
+
1159
1159
+
let mut commits = CollectionCommits::default();
1160
1160
+
commits.total_seen += 1;
1161
1161
+
commits.dids_estimate.insert(&did);
1162
1162
+
commits.truncating_insert(commit, 1);
1163
1163
+
1164
1164
+
let mut commits_by_nsid = HashMap::new();
1165
1165
+
commits_by_nsid.insert(collection, commits);
1166
1166
+
1167
1167
+
write.insert_batch(EventBatch {
1168
1168
+
commits_by_nsid,
1128
1169
..Default::default()
1129
1170
})?;
1130
1171