Description
In src/client/graphics/layers/UnitDisplay.ts, the tick() method calls player.buildables(undefined, BuildMenus.types) without guarding against overlapping requests or handling promise rejections.
Potential Issues
- Race condition: If
tick() is called multiple times before the first promise resolves, older responses may overwrite newer state in this.playerBuildables.
- Unhandled rejections: Missing
.catch() handler could allow unhandled promise rejections.
Context
This was flagged during review of PR #3220 but deferred for separate investigation.
Requested by: @VariableVince
PR: #3220
Review comment: #3220 (comment)
Next Steps
Verify whether the race condition can occur in practice and whether error handling is needed.
Description
In
src/client/graphics/layers/UnitDisplay.ts, thetick()method callsplayer.buildables(undefined, BuildMenus.types)without guarding against overlapping requests or handling promise rejections.Potential Issues
tick()is called multiple times before the first promise resolves, older responses may overwrite newer state inthis.playerBuildables..catch()handler could allow unhandled promise rejections.Context
This was flagged during review of PR #3220 but deferred for separate investigation.
Requested by: @VariableVince
PR: #3220
Review comment: #3220 (comment)
Next Steps
Verify whether the race condition can occur in practice and whether error handling is needed.