@@ -19,8 +19,8 @@ use locality_core::conflict::unresolved_conflict_marker_line;
1919use locality_core:: diff:: property_value_from_frontmatter;
2020use locality_core:: freshness:: RemoteVersion ;
2121use locality_core:: journal:: {
22- JournalApplyEffect , JournalEntry , JournalMetadata , JournalPreimage , JournalStatus ,
23- JournalStore , PushId ,
22+ JournalApplyEffect , JournalEntry , JournalLocalProjectionItem , JournalMetadata , JournalPreimage ,
23+ JournalStatus , JournalStore , PushId ,
2424} ;
2525use locality_core:: model:: { CanonicalDocument , EntityKind , HydrationState , MountId , RemoteId } ;
2626use locality_core:: path_projection:: {
@@ -341,16 +341,18 @@ where
341341 . ok ( )
342342 . map ( |duration| duration. as_millis ( ) ) ;
343343 let readable_diff = prepared. readable_diff . clone ( ) ;
344+ let local_projection_items =
345+ local_projection_items_for_plan ( store, & prepared. mount , prepared. pipeline . plan . as_ref ( ) ) ?;
344346 let mut execution_request = PushExecutionRequest :: new (
345347 push_id. clone ( ) ,
346348 prepared. mount . mount_id . clone ( ) ,
347349 prepared. pipeline . clone ( ) ,
348350 )
349351 . with_remote_preconditions ( remote_preconditions)
350- . with_metadata ( JournalMetadata :: anonymous (
351- previous_push_id,
352- created_at_unix_ms ,
353- ) )
352+ . with_metadata (
353+ JournalMetadata :: anonymous ( previous_push_id, created_at_unix_ms )
354+ . with_local_projection_items ( local_projection_items ) ,
355+ )
354356 . with_readable_diff ( readable_diff. clone ( ) ) ;
355357
356358 if !prepared. shadows . is_empty ( ) {
@@ -411,6 +413,41 @@ where
411413 }
412414}
413415
416+ fn local_projection_items_for_plan < S > (
417+ store : & S ,
418+ mount : & MountConfig ,
419+ plan : Option < & PushPlan > ,
420+ ) -> LocalityResult < Vec < JournalLocalProjectionItem > >
421+ where
422+ S : VirtualMutationRepository ,
423+ {
424+ if !mount. projection . uses_virtual_filesystem ( ) {
425+ return Ok ( Vec :: new ( ) ) ;
426+ }
427+ let Some ( plan) = plan else {
428+ return Ok ( Vec :: new ( ) ) ;
429+ } ;
430+
431+ let mut items = Vec :: new ( ) ;
432+ for ( operation_index, operation) in plan. operations . iter ( ) . enumerate ( ) {
433+ let source_path = match operation {
434+ PushOperation :: CreateEntity { source_path, .. }
435+ | PushOperation :: CreateDatabase { source_path, .. } => source_path,
436+ _ => continue ,
437+ } ;
438+ if let Some ( mutation) = store
439+ . find_virtual_mutation_by_path ( & mount. mount_id , source_path)
440+ . map_err ( LocalityError :: from) ?
441+ {
442+ items. push ( JournalLocalProjectionItem {
443+ operation_index,
444+ local_id : mutation. local_id ,
445+ } ) ;
446+ }
447+ }
448+ Ok ( items)
449+ }
450+
414451fn block_ambiguous_gmail_send_replay < S > (
415452 store : & S ,
416453 prepared : & PreparedPush ,
0 commit comments