Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid calling onchange callback on sync event if property isn't changed #378

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

pennam
Copy link
Collaborator

@pennam pennam commented Sep 20, 2023

Issue

on sync events the on-change callback is invoked also if property is not changed

How to reproduce

Create a sketch with one int property, connect the board and set the property value with a value widget, the property get synced. Stop network and restart it, the on-change callback is invoked also if the property value is not changed

Other info

Apply this changes the on-change callback is still called on the first sync event during first connection

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b4f5275) 95.00% compared to head (a4d0fbc) 95.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #378   +/-   ##
=======================================
  Coverage   95.00%   95.00%           
=======================================
  Files          27       27           
  Lines        1220     1221    +1     
=======================================
+ Hits         1159     1160    +1     
  Misses         61       61           
Files Changed Coverage Δ
src/property/Property.cpp 89.78% <100.00%> (+0.04%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

Memory usage change @ a4d0fbc

Board flash % RAM for global variables %
arduino:esp32:nano_nora 🔺 +12 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_giga:giga 🔺 0 - +64 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_opta:opta 🔺 0 - +64 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 🔺 0 - +16 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:renesas_uno:unor4wifi 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
esp32:esp32:esp32 🔺 +12 - +20 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 0 - +16 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ArduinoIoTCloud-Advanced
flash
% examples/ArduinoIoTCloud-Advanced
RAM for global variables
% examples/ArduinoIoTCloud-Basic
flash
% examples/ArduinoIoTCloud-Basic
RAM for global variables
% examples/ArduinoIoTCloud-Callbacks
flash
% examples/ArduinoIoTCloud-Callbacks
RAM for global variables
% examples/ArduinoIoTCloud-Schedule
flash
% examples/ArduinoIoTCloud-Schedule
RAM for global variables
% examples/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
RAM for global variables
% examples/ArduinoIoTCloud-DeferredOTA
flash
% examples/ArduinoIoTCloud-DeferredOTA
RAM for global variables
% examples/utility/Provisioning
flash
% examples/utility/Provisioning
RAM for global variables
% examples/utility/SelfProvisioning
flash
% examples/utility/SelfProvisioning
RAM for global variables
%
arduino:esp32:nano_nora 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0
arduino:mbed_giga:giga 64 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_opta:opta 0 0.0 0 0.0 64 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 16 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 0 0.0 0 0.0
arduino:renesas_uno:unor4wifi 0 0.0 0 0.0 0 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrgsm1400 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrnb1500 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1300 16 0.01 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0
arduino:samd:mkrwifi1010 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 20 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0 12 0.0 0 0.0
esp8266:esp8266:huzzah 16 0.0 0 0.0 16 0.0 0 0.0 0 0.0 0 0.0 16 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/ArduinoIoTCloud-Advanced<br>flash,%,examples/ArduinoIoTCloud-Advanced<br>RAM for global variables,%,examples/ArduinoIoTCloud-Basic<br>flash,%,examples/ArduinoIoTCloud-Basic<br>RAM for global variables,%,examples/ArduinoIoTCloud-Callbacks<br>flash,%,examples/ArduinoIoTCloud-Callbacks<br>RAM for global variables,%,examples/ArduinoIoTCloud-Schedule<br>flash,%,examples/ArduinoIoTCloud-Schedule<br>RAM for global variables,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>RAM for global variables,%,examples/ArduinoIoTCloud-DeferredOTA<br>flash,%,examples/ArduinoIoTCloud-DeferredOTA<br>RAM for global variables,%,examples/utility/Provisioning<br>flash,%,examples/utility/Provisioning<br>RAM for global variables,%,examples/utility/SelfProvisioning<br>flash,%,examples/utility/SelfProvisioning<br>RAM for global variables,%
arduino:esp32:nano_nora,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0
arduino:mbed_giga:giga,64,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,
arduino:mbed_opta:opta,0,0.0,0,0.0,64,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,,,,
arduino:renesas_portenta:portenta_c33,16,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,,,,,0,0.0,0,0.0,,,,
arduino:renesas_uno:unor4wifi,0,0.0,0,0.0,0,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0,,,,,,,,,,,,
arduino:samd:mkr1000,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,,,,,0,0.0,0,0.0,,,,
arduino:samd:mkrgsm1400,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,,,,,0,0.0,0,0.0,,,,
arduino:samd:mkrnb1500,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,,,,,0,0.0,0,0.0,,,,
arduino:samd:mkrwan1300,16,0.01,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,,,,,,,,,,,,
arduino:samd:mkrwifi1010,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,20,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,12,0.0,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,16,0.0,0,0.0,16,0.0,0,0.0,0,0.0,0,0.0,16,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,,,,,

@per1234 per1234 added the topic: code Related to content of the project itself label Sep 20, 2023
@pennam pennam marked this pull request as ready for review October 9, 2023 06:44
@andreagilardoni andreagilardoni self-requested a review November 8, 2023 09:13
@pennam pennam merged commit babad89 into arduino-libraries:master Nov 23, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants