Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speculative fix for “DUPLICATE_ITEM_IDENTIFIERS” and “EQUAL_IDENTIFIERS_HAVE_DIFFERENT_HASH_VALUES” crasher #620

Merged
merged 1 commit into from
Dec 29, 2022

Conversation

ualch9
Copy link
Member

@ualch9 ualch9 commented Dec 29, 2022

View models now has a guaranteed unique identifier (by UUID during initialization). This is fine for now, since we are directly consuming API results, but at the cost of potentially causing the entire table view to update when one item changes.

Ultimately, OBAListView implementation is flawed and requires a bit of fixing, so this is a stop gap.

…RS_HAVE_DIFFERENT_HASH_VALUES” crasher

Changes view models to always generate a new identifier per instance.

This is a speculative fix and intended as a stop gap (causes entire table view to update) before fixing OBAListView’s flawed implementation.
@ualch9 ualch9 self-assigned this Dec 29, 2022
@@ -33,7 +33,7 @@ extension AgencyAlertListViewConverters where Self: UIViewController {
return TransitAlertDataListViewModel(alert, isUnread: isUnread, forLocale: Locale.current, onSelectAction: presentAlertAction)
}

let alerts = viewModels.uniqued.sorted(by: \.title) // remove duplicates
let alerts = viewModels.sorted(by: \.title) // remove duplicates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@aaronbrethorst
Copy link
Member

looks like a good step forward. nice work 👍

@ualch9
Copy link
Member Author

ualch9 commented Dec 29, 2022

ah-- unit tests succeeded, but CI failing on the "Update xcresult bundle" step. Looks like forks can't access CI results here, for security. I'll move work onto this repo instead, but we should find a way to mark that step as optional for other contributors.

@ualch9 ualch9 merged commit 929fc58 into OneBusAway:main Dec 29, 2022
@ualch9 ualch9 deleted the diffable_data_source branch December 29, 2022 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants