fix: resolve travel anchor ID collision for repeat city pairs
Include segment index in travel anchor IDs ("travel:INDEX:from->to")
so Follow Team trips visiting the same city pair multiple times get
unique, independently addressable travel segments. Prevents override
dictionary collisions and incorrect validDayRange lookups.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -170,10 +170,11 @@ final class ItineraryRowFlatteningTests: XCTestCase {
|
||||
XCTAssertEqual(item.id, "games:2")
|
||||
}
|
||||
|
||||
func test_itineraryRowItem_travel_hasLowercaseId() {
|
||||
func test_itineraryRowItem_travel_hasStableId() {
|
||||
let segment = H.makeTravelSegment(from: "Chicago", to: "Detroit")
|
||||
let item = ItineraryRowItem.travel(segment, dayNumber: 1)
|
||||
XCTAssertEqual(item.id, "travel:chicago->detroit", "Travel ID should be lowercase")
|
||||
XCTAssertTrue(item.id.hasPrefix("travel:"), "Travel ID should start with 'travel:'")
|
||||
XCTAssertTrue(item.id.contains(segment.id.uuidString), "Travel ID should contain segment UUID")
|
||||
}
|
||||
|
||||
func test_itineraryRowItem_customItem_hasUuidId() {
|
||||
|
||||
Reference in New Issue
Block a user