After Summer 18 release on our Sandbox, we encountered couple issues, biggest being:
If i send custom class (with couple maps containing dates as keys) to aura, then stringify it and send it back as raw String to apex, then convert it to said class, I get
"FATAL_ERROR System.JSONException: Invalid format: "Tue May 01 00:00:00 GMT 2018" at [line:1, column:10928]"
Prior to Summer 18, this was not the case, so i'm pretty sure it's because of the new Release.
Any ideas on what to do with it? I'm not changing the date values in any way in Aura, just resending my custom class from aura to apex.
Here is the class code:
public class Warehouse_Report_Details {
@AuraEnabled
public Map<String, Account> accountsMap;
@AuraEnabled
public Account[] accounts;
@AuraEnabled
public Warehouse__c[] warehouses;
@AuraEnabled
public Map<String, Warehouse_hall__c[]> warehouseHallsByWarehouses;
@AuraEnabled
public Map<String, Hall_module__c[]> hallModulesByWarehouseHalls;
@AuraEnabled
public Map<String, Hall_module__c> modulesMap;
@AuraEnabled
public Module_line_item__c[] moduleLineItems;
@AuraEnabled
public Map<Date, Module_line_item__c> moduleLineItemsMap;
@AuraEnabled
public Map<Date, Module_line_item__c> moduleLineItemsMapAll { get; set; }
}
And here is aura JSON:
var data = JSON.stringify(component.get('v.warehouseDetails'));
After sending this value as "rawData" to apex and converting it to class:
Warehouse_Report_Details warehouseReportDetails = (Warehouse_Report_Details) JSON.deserialize(rawData, Warehouse_Report_Details.class);
i get said error.
Edit 1: Part of rawData String where it fails (same column as in error):
"moduleLineItemsMapAll":{"Tue May 01 00:00:00 GMT 2018":{"Hall_module__c":"a0M6E000000o1i6UAA","Date__c":"2018-05-01"
Edit 2: I found something very weird. When i log this in console from client-side. If the element is not open, it shows keys for map as this weird format, but if i expand it i get the right keys. Could this affect the string sent to apex somehow?