Skip to content

Conversation

@dnechay
Copy link
Collaborator

@dnechay dnechay commented Mar 18, 2025

Issue tracking

Fixes #2679

Context behind the change

reward_amount is returned from exchange oracles as string that represents decimal. Even if we convert it to some big int - we will have to store it as string in Redis and then convert it back when responding to client, so taking into account there are no more use cases other than sort we simply pass a comparator function to pagination+sort util when reward_amount property is desired as sort field.

Also changed job discovery process to ensure that it always has all necessary fields before caching jobs in Redis.

How has this been tested?

  • locally: open available jobs page for some oracle and sort "from highest"/"from lowest"
  • locally: open assigned jobs page for some oracle and sort "from highest"/"from lowest"

Release plan

Just merge.

Potential risks; What to monitor; Rollback plan

No.

@vercel
Copy link

vercel bot commented Mar 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
human-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 2:39pm
human-dashboard-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 2:39pm
staking-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 2:39pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
faucet-frontend ⬜️ Ignored (Inspect) Visit Preview Mar 18, 2025 2:39pm
faucet-server ⬜️ Ignored (Inspect) Visit Preview Mar 18, 2025 2:39pm

@dnechay dnechay changed the title Dnechay/2679 [HUMAN App] fix: invalid sorting by reward_amount Mar 18, 2025
@dnechay dnechay requested a review from Dzeranov March 18, 2025 14:08
@dnechay dnechay self-assigned this Mar 18, 2025
@dnechay dnechay merged commit a894ddd into develop Mar 20, 2025
12 checks passed
@dnechay dnechay mentioned this pull request Mar 20, 2025
34 tasks
@dnechay dnechay deleted the dnechay/2679 branch March 24, 2025 12:15
mpblocky pushed a commit to KacperKoza343/human-protocol that referenced this pull request Mar 25, 2025
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.

[Human App][Backend] Invalid sorting when reward_amount of the job is sorting criteria

3 participants