Opened 8 years ago

Closed 6 years ago

#4280 closed defect (needsinfo)

template.name is undefined

Reported by: elexis Owned by:
Priority: Nice to Have Milestone:
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by elexis)

This GUI error was repeated onTick in observer + follow-player mode in an out-of-sync game:

ERROR: JavaScript error: gui/session/selection_details.js line 65
TypeError: template.name is undefined
  displaySingle@gui/session/selection_details.js:65:6
  updateSelectionDetails@gui/session/selection_details.js:458:3
  updateGUIObjects@gui/session/session.js:726:2
  onSimulationUpdate@gui/session/session.js:677:2
  __eventhandler116 (simulationupdate)@sn simulationupdate:0:1

It was likely caused by the player sending a command for a unit which doesn't exist in the simstate of the observer.

Since that error is very noisy and doesn't indicate any code issue, it were better to silence it.

Attachments (1)

commands.txt (829.3 KB ) - added by elexis 8 years ago.
The error is reproducible using r18826 and doing a -visual-replay with that file. The error occurs on turn 2431 the first time (min 20).

Download all attachments as: .zip

Change History (4)

by elexis, 8 years ago

Attachment: commands.txt added

The error is reproducible using r18826 and doing a -visual-replay with that file. The error occurs on turn 2431 the first time (min 20).

comment:1 by elexis, 8 years ago

Similar error with r18815 and that replay:

ERROR: JavaScript error: gui/common/tooltips.js line 546
TypeError: template.name is undefined
  getEntityNames@gui/common/tooltips.js:546:6
  g_SelectionPanels.Selection.setupButton@gui/session/selection_panels.js:942:17
  setupUnitPanel@gui/session/unit_commands.js:96:8
  updateUnitCommands@gui/session/unit_commands.js:147:4
  updateSelectionDetails@gui/session/selection_details.js:467:2
  updateGUIObjects@gui/session/session.js:726:2
  onSimulationUpdate@gui/session/session.js:677:2
  __eventhandler63 (simulationupdate)@sn simulationupdate:0:1

comment:2 by gameboy, 8 years ago

@elexis Do you have a good way to fix it?

comment:3 by elexis, 6 years ago

Description: modified (diff)
Keywords: simple removed
Milestone: Backlog
Resolution: needsinfo
Status: newclosed

For OOS games we certainly don't care (likely the follow-player setting selected a non-exisitng entity).

The command in that replay is

cmd 1 {"type":"set-rallypoint","entities":[15221],"x":409.6252746582031,"z":442.2431945800781,"data":{"command":"gather","resourceType":{"generic":"wood","specific":"tree"},"resourceTemplate":"gaia/flora_tree_senegal_date_palm"},"queued":false}

So it must have been a non-existing entity too. It was sent by Dizaka in an a21 MP games. Not sure how it got there. Probably the entity was destroyed on the turn the command was executed, since the command is sent two turns prior.

Since we didn't get any further reports of non-OOS games, the cause of the error might have been fixed already.

Note: See TracTickets for help on using tickets.