Acknowledged

Bug report: FIT Contributor not working as expected on Edge 540 and 1040 units

We have a CIQ app (called ACS) which is being used by over 200 people.  In the last two weeks we have had people reporting that the data is not being saved to FIT file properly.

The app writes record, lap and session data fields.

The issue is that the session fields are being written not only as session fields but also in place of lap fields. So instead of our intended lap fields, the session data and field names are also appearing as lap fields.

The error is happening on at least the 540 and 1040.

We have not changed anything in the fitcontributor modules since last October so I believe the problem is a bug in ConnectIQ.

The CIQ code to create the fields is shown below:

			fields[WIND_YAW_FIELD] = session.createField("wind_yaw",WIND_YAW_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"deg"});
			fields[WIND_SPEED_FIELD] = session.createField("wind_speed",WIND_SPEED_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"m/s"});
			fields[BAROMETRIC_PRESSURE_FIELD] = session.createField("barometric_pressure",BAROMETRIC_PRESSURE_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"Pa"});
			fields[AIR_DENSITY_FIELD] = session.createField("air_density",AIR_DENSITY_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"kg/m3"});
			fields[RIDER_POWER_FIELD] = session.createField("rider_power",RIDER_POWER_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"W"});
			fields[AERO_POWER_FIELD] = session.createField("aero_power",AERO_POWER_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"W"});
			fields[GRAV_POWER_FIELD] = session.createField("grav_power",GRAV_POWER_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"W"});
			fields[FRIC_POWER_FIELD] = session.createField("fric_power",FRIC_POWER_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"W"});
			fields[AERO_POS_HEAD_FIELD] = session.createField("aero_pos_head",AERO_POS_HEAD_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"cm"});
			fields[AERO_POS_CHEST_FIELD] = session.createField("aero_pos_chest",AERO_POS_CHEST_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"cm"});
			fields[CDA_FIELD] = session.createField("cda",CDA_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"m2"});
			fields[LAP_FIELD] = session.createField("lap",LAP_FIELD,Fit.DATA_TYPE_SINT16,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>""});
			fields[CDA_LAP_RECORD_FIELD] = session.createField("cda_lap_record",CDA_LAP_RECORD_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"m2"});
			fields[ROAD_SPEED_FIELD] = session.createField("road_speed",ROAD_SPEED_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"m/s"});
			fields[CDA_STATUS_FIELD] = session.createField("cda_status",CDA_STATUS_FIELD,Fit.DATA_TYPE_UINT16,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>""});
			fields[AS_VOLTAGE_FIELD] = session.createField("as_voltage",AS_VOLTAGE_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"V"});

			fields[CDA_LAP_FIELD] = session.createField("cda_lap",CDA_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"m2"});
			fields[HEAD_POS_LAP_FIELD] = session.createField("head_pos_lap",HEAD_POS_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"cm"});
			fields[CHEST_POS_LAP_FIELD] = session.createField("chest_pos_lap",CHEST_POS_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"cm"});
			fields[LAPTIME_FIELD] = session.createField("laptime",LAPTIME_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"s"});
			fields[AERO_CAL_LAP_FIELD] = session.createField("aero_cal_lap",AERO_CAL_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>""});
			fields[RIDER_POWER_LAP_FIELD] = session.createField("rider_power_lap",RIDER_POWER_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"W"});
			fields[AERO_POWER_LAP_FIELD] = session.createField("aero_power_lap",AERO_POWER_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"W"});
			fields[GRAV_POWER_LAP_FIELD] = session.createField("grav_power_lap",GRAV_POWER_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"W"});
			fields[FRIC_POWER_LAP_FIELD] = session.createField("fric_power_lap",FRIC_POWER_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"W"});
			fields[KIN_POWER_LAP_FIELD] = session.createField("kin_power_lap",KIN_POWER_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"W"});
			fields[PDYN_POWER_LAP_FIELD] = session.createField("pdyn_power_lap",PDYN_POWER_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"W/m2"});
			fields[DISTANCE_LAP_FIELD] = session.createField("distance_lap",DISTANCE_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"revs"});
			fields[WIND_YAW_LAP_FIELD] = session.createField("wind_yaw_lap",WIND_YAW_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"deg"});
			fields[HEADWIND_LAP_FIELD] = session.createField("headwind_lap",HEADWIND_LAP_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_LAP, :units=>"m/s"});
			
			fields[TOTAL_MASS_SETTING_FIELD] = session.createField("total_mass_setting",TOTAL_MASS_SETTING_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"kg"});
			fields[AERO_CAL_SETTING_FIELD] = session.createField("aero_cal_setting",AERO_CAL_SETTING_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>""});
			fields[WHEEL_CIRC_SETTING_FIELD] = session.createField("wheel_circ_setting",WHEEL_CIRC_SETTING_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"mm"});
			fields[PM_SCALING_SETTING_FIELD] = session.createField("pm_scaling_setting",PM_SCALING_SETTING_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>""});
			fields[CRR_SETTING_FIELD] = session.createField("crr_setting",CRR_SETTING_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>""});
			fields[LAP_COUNT_FIELD] = session.createField("lap_count",LAP_COUNT_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>""});
			fields[CDA_SESSION_FIELD] = session.createField("cda_session",CDA_SESSION_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"m2"});
			fields[LAPTIME_SESSION_FIELD] = session.createField("laptime_session",LAPTIME_SESSION_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"s"});
			fields[HEAD_POS_SESSION_FIELD] = session.createField("head_pos_session",HEAD_POS_SESSION_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"cm"});
			fields[CHEST_POS_SESSION_FIELD] = session.createField("chest_pos_session",CHEST_POS_SESSION_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"cm"});
			fields[HEAD_REF_SESSION_FIELD] = session.createField("head_ref_session",HEAD_REF_SESSION_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"cm"});
			fields[CHEST_REF_SESSION_FIELD] = session.createField("chest_ref_session",CHEST_REF_SESSION_FIELD,Fit.DATA_TYPE_FLOAT,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"cm"});
			fields[TEST_TYPE_FIELD] = session.createField("test_type",TEST_TYPE_FIELD,Fit.DATA_TYPE_UINT8,{ :mesgType=>Fit.MESG_TYPE_SESSION, :units=>""});