I make a Scheduled Task as follows.
Type of task: Run actions on each player in a segment
Segment: All Players
Actions:
- Type: Execute Cloud Script
- Dev_Event_ParseRankStatAndApplyAnother
- Check Publish results as PlayStream Event
- Cloud Script Function: Dev_Event_ParseRankStatAndApplyAnother
- Arguments: {"SrcRegionCode":"KR","DestRegionCode":"ASIA","IsTest":false}
And I've got all the players working with CloudScript.
Each user worked in two different ways.
And I delete the task,
I've created the same task and I've worked on it.
All the other users who had previously worked in two different ways,
now worked same and properly.
I'm very embarrassed.
In the meantime, I've had a lot of work done to the entire user as a schedule task.
But now I am completely unreliable about my work.
Question 1. What's the problem?
Question2. How can I check if this happens again in the future?
My Title ID: FC890
First Task Instance ID: 50D00A73EE9D08B
Second Task Instance ID: 1FCDBD2B87356CB1
Below Users normal operation result event.
- CFFD05245DF7B4
- 4653DFBC132195CF
...
Below Users malfunction operation result event.
- AE3753F4F6F805E5
- 492A6B9737690AAD
...
Below is the expected malfunction.
const Util = { IsTest: false, Init_TestMode() { this.IsTest = true; }, ... ... ... } handlers.Dev_Event_ParseRankStatAndApplyAnother = function (args, context) { let srcRegionCode = args["SrcRegionCode"]; let destRegionCode = args["DestRegionCode"]; let isTest = true; if(args.hasOwnProperty("IsTest")) { isTest = args["IsTest"]; } if(isTest) Util.Init_TestMode(); ... ... ... let resultObj = {}; if(Util.IsTest) { resultObj["URDataToUpdate"] = uRDataToUpdate; } return resultObj; }
As an argument, we gave {"IsTest": false} to execute it.
At the top, the isTest should be false.
But Util.IsTest becomes true.
And,
if(Util.IsTest)
{ resultObj["URDataToUpdate"] = uRDataToUpdate; }
is executed and receives a function result from the result event.
This is not supposed to be done.
Below are the result events of the normal user and the result events of the malfunction user, respectively.
CFFD05245DF7B4 User Normal Operation Result Event
{ "PlayFabEnvironment": { "Application": "logicserver", "Vertical": "master", "Commit": "1b7b02b", "Cloud": "main" }, "CloudScriptExecutionResult": { "FunctionName": "Dev_Event_ParseRankStatAndApplyAnother", "ExecutionTimeSeconds": 0.0616742, "ProcessorTimeSeconds": 0.0, "MemoryConsumedBytes": 29024, "HttpRequestsIssued": 0, "APIRequestsIssued": 2, "FunctionResult": {}, "Revision": 387, "Logs": [] }, "FunctionName": "Dev_Event_ParseRankStatAndApplyAnother", "EventNamespace": "com.playfab", "TitleId": "FC890", "EntityType": "player", "SourceType": "BackEnd", "TriggeringPlayer": { "PushNotificationRegistrations": [], "PlayerExperimentVariants": [], "VirtualCurrencyBalances": { "GD": 1442, "DM": 0, "FD": 150, "SP": 0, "EP": 1 }, "AdCampaignAttributions": [], "ContactEmailAddresses": [], "TitleId": "FC890", "LastLogin": "2020-07-24T05:46:06.7663505Z", "PlayerMemberships": [], "PlayerStatistics": [ { "StatisticVersion": 10, "StatisticValue": 505, "Name": "MaxRankScore", "Id": "9173904A" }, { "StatisticVersion": 10, "StatisticValue": 505, "Name": "KR", "Id": "BB6C4A46" }, { "StatisticVersion": 10, "StatisticValue": -1, "Name": "KR_0", "Id": "1F1CCBCC" }, { "StatisticVersion": 10, "StatisticValue": 505, "Name": "KR_1", "Id": "FCAF855A" }, { "StatisticVersion": 11, "StatisticValue": -1, "Name": "KR_0", "Id": "1F1CCBCC" }, { "StatisticVersion": 11, "StatisticValue": -1, "Name": "KR_1", "Id": "FCAF855A" }, { "StatisticVersion": 11, "StatisticValue": 1280, "Name": "KR", "Id": "BB6C4A46" }, { "StatisticVersion": 11, "StatisticValue": 1280, "Name": "KR_2", "Id": "65B863E" }, { "StatisticVersion": 11, "StatisticValue": -1, "Name": "ASIA_0", "Id": "68BE0B3F" }, { "StatisticVersion": 11, "StatisticValue": 1843, "Name": "MaxRankScore", "Id": "9173904A" }, { "StatisticVersion": 11, "StatisticValue": 1843, "Name": "ASIA", "Id": "398F8CF" }, { "StatisticVersion": 11, "StatisticValue": 1843, "Name": "ASIA_2", "Id": "FCB796C1" }, { "StatisticVersion": 0, "StatisticValue": 0, "Name": "LastEquip", "Id": "12E26200" } ], "LinkedAccounts": [ { "PlatformUserId": "a951790185b448b4", "Platform": "AndroidDevice" } ], "ValuesToDate": {}, "Origination": "AndroidDevice", "PublisherId": "3C4AB8DB9B800B6F", "DisplayName": "폭탄보이", "Statistics": { "MaxRankScore": 1843, "LastEquip": 0, "ASIA_0": -1, "ASIA": 1843, "KR_0": -1, "KR": 1280, "KR_1": -1, "ASIA_2": 1843, "KR_2": 1280 }, "Locations": { "LastLogin": { "ContinentCode": "AS", "CountryCode": "KR", "City": "Seoul" } }, "PlayerId": "CFFD05245DF7B4", "Created": "2020-05-06T21:13:54.0379942Z", "Tags": [] }, "Timestamp": "2020-07-28T06:49:45.4824129Z", "EventName": "player_triggered_action_executed_cloudscript", "EntityId": "CFFD05245DF7B4", "EventId": "a321be36301d4393bd26603a8cf766e0", "Source": "CloudScript" }
AE3753F4F6F805E5 User's malfunction result event
{ "PlayFabEnvironment": { "Application": "logicserver", "Vertical": "master", "Commit": "1b7b02b", "Cloud": "main" }, "CloudScriptExecutionResult": { "FunctionName": "Dev_Event_ParseRankStatAndApplyAnother", "ExecutionTimeSeconds": 0.0325673, "ProcessorTimeSeconds": 0.0, "MemoryConsumedBytes": 288880, "HttpRequestsIssued": 0, "APIRequestsIssued": 1, "FunctionResult": { "URDataToUpdate": { "RankStat": "{\"Datas\":[{\"Region\":\"ASIA\",\"Codes\":[\"11-2379-2379-180-151-96-15-10-0_0_0_0\"]},{\"Region\":\"AU\",\"Codes\":[]},{\"Region\":\"CAE\",\"Codes\":[]},{\"Region\":\"CN\",\"Codes\":[]},{\"Region\":\"EU\",\"Codes\":[]},{\"Region\":\"IN\",\"Codes\":[]},{\"Region\":\"JP\",\"Codes\":[]},{\"Region\":\"RU\",\"Codes\":[]},{\"Region\":\"RUE\",\"Codes\":[]},{\"Region\":\"SA\",\"Codes\":[]},{\"Region\":\"KR\",\"Codes\":[\"11-2379-2379-180-151-96-15-10-8_0_0_0\"]},{\"Region\":\"US\",\"Codes\":[]},{\"Region\":\"USW\",\"Codes\":[]}]}" } }, "Revision": 387, "Logs": [] }, "FunctionName": "Dev_Event_ParseRankStatAndApplyAnother", "EventNamespace": "com.playfab", "TitleId": "FC890", "EntityType": "player", "SourceType": "BackEnd", "TriggeringPlayer": { "PushNotificationRegistrations": [], "PlayerExperimentVariants": [], "VirtualCurrencyBalances": { "GD": 632, "DM": 0, "FD": 150, "SP": 0, "EP": 2 }, "AdCampaignAttributions": [], "ContactEmailAddresses": [], "TitleId": "FC890", "LastLogin": "2020-07-22T05:13:19.6829632Z", "PlayerMemberships": [], "PlayerStatistics": [ { "StatisticVersion": 11, "StatisticValue": -1, "Name": "KR_0", "Id": "1F1CCBCC" }, { "StatisticVersion": 11, "StatisticValue": -1, "Name": "KR_1", "Id": "FCAF855A" }, { "StatisticVersion": 11, "StatisticValue": -1, "Name": "KR_2", "Id": "65B863E" }, { "StatisticVersion": 11, "StatisticValue": 2379, "Name": "MaxRankScore", "Id": "9173904A" }, { "StatisticVersion": 11, "StatisticValue": 2379, "Name": "KR", "Id": "BB6C4A46" }, { "StatisticVersion": 11, "StatisticValue": 2379, "Name": "KR_3", "Id": "156801F" }, { "StatisticVersion": 11, "StatisticValue": 2379, "Name": "ASIA", "Id": "398F8CF" }, { "StatisticVersion": 11, "StatisticValue": -1, "Name": "ASIA_0", "Id": "68BE0B3F" }, { "StatisticVersion": 11, "StatisticValue": 2379, "Name": "ASIA_3", "Id": "D43A1A0D" }, { "StatisticVersion": 0, "StatisticValue": 0, "Name": "LastEquip", "Id": "12E26200" } ], "LinkedAccounts": [ { "PlatformUserId": "a93c749b85f3469d", "Platform": "AndroidDevice" } ], "ValuesToDate": {}, "Origination": "AndroidDevice", "PublisherId": "3C4AB8DB9B800B6F", "DisplayName": "키루키루TV", "Statistics": { "MaxRankScore": 2379, "LastEquip": 0, "ASIA_0": -1, "ASIA": 2379, "KR_0": -1, "KR": 2379, "KR_1": -1, "KR_2": -1, "ASIA_3": 2379, "KR_3": 2379 }, "Locations": { "LastLogin": { "ContinentCode": "AS", "CountryCode": "KR", "City": "Namyangju" } }, "PlayerId": "AE3753F4F6F805E5", "Created": "2020-07-04T10:44:48.3870948Z", "Tags": [] }, "Timestamp": "2020-07-28T06:47:34.9159267Z", "EventName": "player_triggered_action_executed_cloudscript", "EntityId": "AE3753F4F6F805E5", "EventId": "bc5d3a41152e4f789780b3054cd5cb7b", "Source": "CloudScript" }