Skip to content

fix: correct sorting logic for pending changes sequence#39

Open
Amadeusz-P wants to merge 1 commit into
matisiekpl:mainfrom
Amadeusz-P:fix/pending-changes-sort
Open

fix: correct sorting logic for pending changes sequence#39
Amadeusz-P wants to merge 1 commit into
matisiekpl:mainfrom
Amadeusz-P:fix/pending-changes-sort

Conversation

@Amadeusz-P

Copy link
Copy Markdown
Contributor

This Pull Request fixes an issue where pending edits or changes submitted by users were not being sorted or displayed in the correct chronological or prioritized order.
Changes Introduced

Sorting Logic Fix: Corrected the underlying sorting algorithm/comparator applied to the pending changes list before it gets rendered or processed.

UI Consistency: Ensures that the most relevant or recent edits appear in the expected sequence inside the moderation/queue view, preventing layout confusion or outdated entries from overlapping.

Data Integrity: Cleaned up the data pipeline to handle null or missing timestamp values safely during the sorting process without crashing the collection view.

@netlify

netlify Bot commented May 26, 2026

Copy link
Copy Markdown

👷 Deploy request for aedmap pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4091650

@matisiekpl

Copy link
Copy Markdown
Owner

But old solution for sorting kept changed AEDs in the map visible.
I travel a lot between Kraków and Rzeszów and I think, user should be able to see edited AEDs in Kraków, while he moved to Rzeszów for a while.

What do you think?

This PR talks about chronological order, but clearly introduces distance-based sorting.

@Amadeusz-P

Copy link
Copy Markdown
Contributor Author

But old solution for sorting kept changed AEDs in the map visible. I travel a lot between Kraków and Rzeszów and I think, user should be able to see edited AEDs in Kraków, while he moved to Rzeszów for a while.

What do you think?

This PR talks about chronological order, but clearly introduces distance-based sorting.

I will think about it again.
I thought this as elegant solution as main problem to fix is the fact that when I edited AED it taken place as my nearest one, effectively killing main purpose of the map that is helping in emergency situations.

@matisiekpl

Copy link
Copy Markdown
Owner

@Amadeusz-P Oh, really we have this bug? Considering scenario:

  1. I edit some AED that is far away from me
  2. I navigate to nearest AED
  3. Shown AED is not really my nearest AED?
    In such case following PR is crucial to fix the bug.

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