Page MenuHomeFeedback Tracker

[Display Bug] removeDiaryRecord conflicts with allDiaryRecords
New, NormalPublic

Description

If allDiaryRecords is used immediately after removeDiaryRecord, it blocks the display update.
The diary record is removed internally but remains visible on the screen.
The player must manually switch to another subject before the display updates.
This issue does not occur if removeDiaryRecord runs after the allDiaryRecords command.
Worth to notice that issue also does not occur if player didn't selected affected subject before (Must be selected for the issue to appear).

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
22H2
Category
Scripting
Steps To Reproduce
  1. Place the player and two units on the map.
  2. Use the variables for the units: TestUnit1 and TestUnit2.
  3. Place the following code into init.sqf and run the preview.
  4. Open map and select Shop list subject in diary.
  5. Close the map and remove record through provided action attached to the unit.
  6. Open map and look at Shop list subject in diary again.
  7. Optional- Switch diary subject to update the display.
//Code that blocks display update
player createDiarySubject ["ShopLists","Shop lists"];

_list = player createDiaryRecord ["ShopLists", ["List 1","example list 1"]];
TestUnit1 setVariable ["ShopList",_list];
_list2 = player createDiaryRecord ["ShopLists", ["List 2","example list 2"]];
TestUnit2 setVariable ["ShopList",_list2];

{
_x addAction
[
	"Remove",	// title
	{
		params ["_target"];
		private _list = _target getVariable ["ShopList",diaryRecordNull];
		player removeDiaryRecord ["ShopLists",_list];
		(player allDiaryRecords "ShopLists");//Problem-blocks display update
	}
];
} forEach [TestUnit1,TestUnit2];
Additional Information
//Working code
player createDiarySubject ["ShopLists","Shop lists"];

_list = player createDiaryRecord ["ShopLists", ["List 1","example list 1"]];
TestUnit1 setVariable ["ShopList",_list];
_list2 = player createDiaryRecord ["ShopLists", ["List 2","example list 2"]];
TestUnit2 setVariable ["ShopList",_list2];

{
_x addAction
[
	"Remove",	// title
	{
		params ["_target"];
		private _list = _target getVariable ["ShopList",diaryRecordNull];
		(player allDiaryRecords "ShopLists");//No problem at all
		player removeDiaryRecord ["ShopLists",_list];
	}
];
} forEach [TestUnit1,TestUnit2];

I believe removeDiaryRecord should work independently of other commands and update the display at the moment the diary record is removed.
I don’t have much else to add, except thank you for looking into this issue. If you need anything else, I’m happy to help however I can.

Event Timeline

soldierXXXX updated the task description. (Show Details)Sat, Jun 21, 12:45 AM
soldierXXXX edited Steps To Reproduce. (Show Details)