Altinn / Altinn/app-frontend-react
Map loading is sometimes flaky (makes PDF time out)
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description of the bug
Slack: https://altinn.slack.com/archives/C02EJ9HKQA3/p1744023729225749
Sometimes map tiles from Kartverket fail to load as seen in the image below, you can see the open-streetmap layer underneath in two of the tiles:
For some reason, the browser seems to use 60 seconds before it triggers the `error`-event, which means that the PDF will time out before this time. It is a little hard to reproduce, I was able to make it happen relatively consistently by having several maps with a "new" location each time, so I suspect it has something to do with Kartverkets own caching, since it usually works consistently in subsequent attempts.
## Workarounds
- Don't use kartverkets map layer and only use the one from open-streetmap
- Use old map summary for PDF if you select a location. (this will only show coordinates and not render the actual map)
- https://github.com/Altinn/app-frontend-react/issues/3126
### Steps To Reproduce
1. Have many map components where the map is visible in PDF (summary2)
2. If you are (un)lucky you will see that a few random tiles from Kartverket fails to load after a very long time with 504 gateway timeout.
### Additional Information
_No response_
Contributor guide
Research direction
Start by reproducing the issue with many map components rendered in PDF through summary2, using fresh locations to trigger Kartverket tile failures. Trace the map component's tile-loading path and the PDF timeout behavior; done means intermittent failed tiles no longer cause PDF generation to time out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100