@@ -92,15 +92,12 @@ export class AgentActivityRows extends Context.Service<
9292> ( ) ( "t3code-relay/agentActivity/AgentActivityRows" ) { }
9393
9494const decodeJsonString = Schema . decodeEffect ( Schema . fromJsonString ( Schema . Unknown ) ) ;
95- const encodeJsonValue = Schema . encodeEffect ( Schema . fromJsonString ( Schema . Unknown ) ) ;
9695
9796const encodeRelayAgentActivityStateJson = Schema . encodeEffect (
9897 Schema . fromJsonString ( RelayAgentActivityStateSchema ) ,
9998) ;
10099
101- const decodeRelayAgentActivityStateJson = Schema . decodeUnknownOption (
102- Schema . fromJsonString ( RelayAgentActivityStateSchema ) ,
103- ) ;
100+ const decodeRelayAgentActivityState = Schema . decodeUnknownOption ( RelayAgentActivityStateSchema ) ;
104101
105102export const make = Effect . gen ( function * ( ) {
106103 const db = yield * RelayDb . RelayDb ;
@@ -229,13 +226,8 @@ export const make = Effect.gen(function* () {
229226 )
230227 . orderBy ( desc ( relayAgentActivityRows . updatedAt ) )
231228 . pipe (
232- Effect . flatMap ( ( rows ) =>
233- Effect . forEach ( rows , ( row ) => encodeJsonValue ( row . stateJson ) , {
234- concurrency : "unbounded" ,
235- } ) ,
236- ) ,
237229 Effect . map ( ( rows ) =>
238- rows . flatMap ( ( row ) => Option . toArray ( decodeRelayAgentActivityStateJson ( row ) ) ) ,
230+ rows . flatMap ( ( row ) => Option . toArray ( decodeRelayAgentActivityState ( row . stateJson ) ) ) ,
239231 ) ,
240232 Effect . mapError (
241233 ( cause ) =>
@@ -271,14 +263,9 @@ export const make = Effect.gen(function* () {
271263 )
272264 . orderBy ( desc ( relayAgentActivityRows . updatedAt ) )
273265 . pipe (
274- Effect . flatMap ( ( rows ) =>
275- Effect . forEach ( rows , ( row ) => encodeJsonValue ( row . stateJson ) , {
276- concurrency : "unbounded" ,
277- } ) ,
278- ) ,
279266 Effect . map ( ( rows ) => {
280267 for ( const row of rows ) {
281- const decoded = decodeRelayAgentActivityStateJson ( row ) ;
268+ const decoded = decodeRelayAgentActivityState ( row . stateJson ) ;
282269 if ( Option . isSome ( decoded ) ) {
283270 return decoded . value ;
284271 }
0 commit comments