mount public data from the atmosphere to a virtual filesystem (macos only) pdfs.at
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(atproto): Task 5 polish — sorted-key didDoc, remove @discardableResult, document AnyDecodable precision

+8 -2
+7
Packages/ATProto/Sources/ATProto/XRPC/AnyDecodable.swift
··· 2 2 3 3 /// Helper to decode arbitrary JSON values into `Any` for pass-through storage. 4 4 /// Used by XRPC outputs that carry opaque record values through to callers. 5 + /// 6 + /// Known precision caveats — fine for DID docs and typical atproto records, 7 + /// worth auditing if records with extreme integer or signature-sensitive 8 + /// numeric values show up: 9 + /// - Integers > Int64.max fall through to Double and lose precision past 2^53. 10 + /// - Whole-number Doubles (e.g. `1.0`) decode as Int64(1) because Int64 is 11 + /// tried first, so `1.0` round-trips as `1` via JSONSerialization. 5 12 struct AnyDecodable: Decodable { 6 13 let value: Any 7 14
+1 -1
Packages/ATProto/Sources/ATProto/XRPC/DescribeRepoOutput.swift
··· 22 22 handleIsCorrect = try c.decodeIfPresent(Bool.self, forKey: .handleIsCorrect) 23 23 if c.contains(.didDoc) { 24 24 let any = try c.decode(AnyDecodable.self, forKey: .didDoc) 25 - didDoc = try JSONSerialization.data(withJSONObject: any.value) 25 + didDoc = try JSONSerialization.data(withJSONObject: any.value, options: [.sortedKeys]) 26 26 } else { 27 27 didDoc = nil 28 28 }
-1
Packages/ATProto/Tests/ATProtoTests/Support/URLProtocolStub.swift
··· 39 39 40 40 /// Installs a request handler and returns a configured `URLSession`. 41 41 /// Pass the returned session to `reset(session:)` in a `defer` block. 42 - @discardableResult 43 42 static func install(handler: @escaping (URLRequest) -> Response) -> URLSession { 44 43 let id = UUID().uuidString 45 44 let config = URLSessionConfiguration.ephemeral