Skip to content

fix: events sync error due to spaces in fields filters#1065

Open
MatiasArriola wants to merge 1 commit into
developmentfrom
fix/spaces-in-filters-route-error
Open

fix: events sync error due to spaces in fields filters#1065
MatiasArriola wants to merge 1 commit into
developmentfrom
fix/spaces-in-filters-route-error

Conversation

@MatiasArriola
Copy link
Copy Markdown
Contributor

📌 References

📝 Implementation

  • Tested in v42 only, but I assume it can be reproducible in all versions
  • The problem is that if any Route url contains unencoded spaces it will fail with a 400 error.

Example:

GET http://localhost:8081/dhis2/api/routes/HC1CpN3KuQy/run/api/metadata?fields=id,programType, programTrackedEntityAttributes[trackedEntityAttribute],programStages[id,programStageDataElements[dataElement]]&filter=id:in:[cn4tDPLFfOT]&defaults=EXCLUDE :

{
    "httpStatus": "Bad Request",
    "httpStatusCode": 400,
    "status": "ERROR",
    "message": "Illegal character in query at index 60: http://{ip:port-redacted}/api/metadata?fields=id,programType, programTrackedEntityAttributes[trackedEntityAttribute],programStages[id,programStageDataElements[dataElement]]&filter=id:in:[cn4tDPLFfOT]&defaults=EXCLUDE"
}
  • After removing the space, it works fine. This was happening in TEIsPayloadMapperFactory but looked for other instances of spaces in filters and found only EventsPayloadMapperFactory

📹 Screenshots/Screen capture

🔥 Is there anything the reviewer should know to test it?

  • Run any events sync

📑 Others

  • Any change in the GUI library? If so, what branch/PR?
    No

  • Any change in the D2 Api? If so, what branch/PR?
    No

@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented May 14, 2026

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
2.75MB (-111B 0%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@adrianq adrianq requested a review from xurxodev May 26, 2026 11:45
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.

1 participant