Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion config/schema/artifacts/datastore_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2218,7 +2218,7 @@ scripts:

// No timestamp values matched the params, so return `false`.
return false;
update_index_data_27fac9da6430f05440528c771880c7e6:
update_index_data_0d2f593f4c3c3084ec4533148311dfca:
context: update
script:
lang: painless
Expand Down Expand Up @@ -2348,6 +2348,10 @@ scripts:
}
}

// Refuses the update in two cases:
// 1. The data comes from a different source document than the one that has fed this document's
// sourced fields before (e.g. an order's `customer` link switching to another customer).
// 2. The event is older than one already applied.
void validateSource(Map doc, String id, String relationship, String sourceId, long eventVersion, String sourceKey) {
Map versionsMap = doc.__versions[sourceKey];
List previousSourceIdsForRelationship = versionsMap.keySet().stream().filter(key -> key != sourceId).collect(Collectors.toList());
Expand Down
44 changes: 22 additions & 22 deletions config/schema/artifacts/runtime_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3152,7 +3152,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
full_address:
cardinality: one
Expand Down Expand Up @@ -3342,7 +3342,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
__typename:
cardinality: one
Expand Down Expand Up @@ -3430,7 +3430,7 @@ object_types_by_name:
relationship: staff.coaches.profile
rollover_timestamp_value_source: team_formed_on
routing_value_source: team_league
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
sourced_from_nested_params:
field_params:
salary:
Expand Down Expand Up @@ -3472,7 +3472,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
__typename:
cardinality: one
Expand Down Expand Up @@ -3575,7 +3575,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
created_at:
cardinality: one
Expand Down Expand Up @@ -3702,7 +3702,7 @@ object_types_by_name:
version:
cardinality: one
relationship: design
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
designer_name:
cardinality: one
Expand Down Expand Up @@ -3922,7 +3922,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
__typename:
cardinality: one
Expand Down Expand Up @@ -4095,7 +4095,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
created_at:
cardinality: one
Expand Down Expand Up @@ -4305,7 +4305,7 @@ object_types_by_name:
relationship: staff.general_manager.profile
rollover_timestamp_value_source: team_formed_on
routing_value_source: team_league
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
sourced_from_nested_params:
field_params:
salary:
Expand Down Expand Up @@ -4640,7 +4640,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
ceo:
cardinality: one
Expand Down Expand Up @@ -4798,7 +4798,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
created_at:
cardinality: one
Expand Down Expand Up @@ -5769,7 +5769,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
__typename:
cardinality: one
Expand Down Expand Up @@ -5968,7 +5968,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
__typename:
cardinality: one
Expand Down Expand Up @@ -6035,7 +6035,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
active:
cardinality: one
Expand Down Expand Up @@ -6572,7 +6572,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
name:
cardinality: one
Expand Down Expand Up @@ -6951,7 +6951,7 @@ object_types_by_name:
relationship: __self
rollover_timestamp_value_source: formed_on
routing_value_source: league
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
country_code:
cardinality: one
Expand Down Expand Up @@ -8090,7 +8090,7 @@ object_types_by_name:
relationship: __self
rollover_timestamp_value_source: created_at
routing_value_source: workspace_id2
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
amount_cents:
cardinality: one
Expand Down Expand Up @@ -8168,7 +8168,7 @@ object_types_by_name:
version:
cardinality: one
relationship: widget
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
widget_cost:
cardinality: one
Expand Down Expand Up @@ -8398,7 +8398,7 @@ object_types_by_name:
relationship: __self
rollover_timestamp_value_source: introduced_on
routing_value_source: primary_continent
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
details:
cardinality: one
Expand Down Expand Up @@ -9443,7 +9443,7 @@ object_types_by_name:
cardinality: one
relationship: __self
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
name:
cardinality: one
Expand All @@ -9465,7 +9465,7 @@ object_types_by_name:
relationship: workspace
rollover_timestamp_value_source: widget.created_at
routing_value_source: id
script_id: update_index_data_27fac9da6430f05440528c771880c7e6
script_id: update_index_data_0d2f593f4c3c3084ec4533148311dfca
top_level_fields_params:
workspace_name:
cardinality: one
Expand Down Expand Up @@ -9700,4 +9700,4 @@ static_script_ids_by_scoped_name:
field/as_day_of_week: field_as_day_of_week_f2b5c7d9e8f75bf2457b52412bfb6537
field/as_time_of_day: field_as_time_of_day_ed82aba44fc66bff5635bec4305c1c66
filter/by_time_of_day: filter_by_time_of_day_ea12d0561b24961789ab68ed38435612
update/index_data: update_index_data_27fac9da6430f05440528c771880c7e6
update/index_data: update_index_data_0d2f593f4c3c3084ec4533148311dfca
6 changes: 5 additions & 1 deletion config/schema/artifacts_with_apollo/datastore_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2218,7 +2218,7 @@ scripts:

// No timestamp values matched the params, so return `false`.
return false;
update_index_data_27fac9da6430f05440528c771880c7e6:
update_index_data_0d2f593f4c3c3084ec4533148311dfca:
context: update
script:
lang: painless
Expand Down Expand Up @@ -2348,6 +2348,10 @@ scripts:
}
}

// Refuses the update in two cases:
// 1. The data comes from a different source document than the one that has fed this document's
// sourced fields before (e.g. an order's `customer` link switching to another customer).
// 2. The event is older than one already applied.
void validateSource(Map doc, String id, String relationship, String sourceId, long eventVersion, String sourceKey) {
Map versionsMap = doc.__versions[sourceKey];
List previousSourceIdsForRelationship = versionsMap.keySet().stream().filter(key -> key != sourceId).collect(Collectors.toList());
Expand Down
Loading