espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.74k stars 7.43k forks source link

fix (NetworkEvents lib) remove checks for duplicated event handlers #10376

Closed vortigont closed 1 month ago

vortigont commented 2 months ago

A refactoring for NetworkEvents class This fixes #10365 issue and supersedes #10337, it removes pointer comparison checks for function pointer handlers but adds more safety to the code working with callback handlers container.

github-actions[bot] commented 2 months ago
Warnings
:warning: **Some issues found for the commit messages in this PR:** - the commit message `"[Network] deprecate NetworkEvents::removeEvent() for std::function callbacks"`: - footer's lines must not be longer than 100 characters - *summary* looks empty - *type/action* looks empty - the commit message `"[Network] hide event task under private member of NetworkEvents class"`: - *summary* looks empty - *type/action* looks empty - the commit message `"lib Network: add cpp syntax to structs"`: - *summary* looks empty - *type/action* looks empty - the commit message `"refactor(NetworkEvents) add (optional) mutex lock for container operations"`: - body's lines must not be longer than 100 characters - *summary* looks empty - *type/action* looks empty - the commit message `"refactor(NetworkEvents) code polishing and comments"`: - body's lines must not be longer than 100 characters - *summary* looks empty - *type/action* looks empty *** **Please fix these commit messages** - here are some basic tips: - follow [Conventional Commits style](https://www.conventionalcommits.org/en/v1.0.0/) - correct format of commit message should be: `(): `, for example `fix(esp32): Fixed startup timeout issue` - allowed types are: `change,ci,docs,feat,fix,refactor,remove,revert,test` - sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter - avoid Jira references in commit messages (unavailable/irrelevant for our customers) `TIP:` Install pre-commit hooks and run this check when committing (uses the [Conventional Precommit Linter](https://github.com/espressif/conventional-precommit-linter)).
:warning: Please consider squashing your 8 commits (simplifying branch history).

👋 Hello vortigont, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by :no_entry_sign: dangerJS against ab1d55ddb026cfa449502913aed9b38444d0fcf0

github-actions[bot] commented 2 months ago

Test Results

 56 files   56 suites   4m 11s ⏱️  21 tests  21 ✅ 0 💤 0 ❌ 134 runs  134 ✅ 0 💤 0 ❌

Results for commit ab1d55dd.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 2 months ago

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S3:green_heart: -32:warning: +5560.00:warning: +0.06:green_heart: -160:green_heart: -0.070.00
ESP32S2:green_heart: -36:warning: +5440.00:warning: +0.06:green_heart: -160:green_heart: -0.040.00
ESP32C30:warning: +6240.00:warning: +0.060:warning: +160.00:warning: +0.05
ESP32C60:warning: +6240.00:warning: +0.060:warning: +160.00:warning: +0.04
ESP32H20:warning: +1160.00:warning: +0.02000.000.00
ESP32:green_heart: -32:warning: +568:green_heart: -0.01:warning: +0.06:green_heart: -160:green_heart: -0.040.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
Ethernet/examples/ETH_W5500_Arduino_SPI:green_heart: -20:green_heart: -16:green_heart: -40:warning: +1040:warning: +980:warning: +740:green_heart: -320
Ethernet/examples/ETH_W5500_IDF_SPI:green_heart: -16:green_heart: -1600:warning: +1040:warning: +980:warning: +740:green_heart: -320
Ethernet/examples/ETH_WIFI_BRIDGE:warning: +4920:warning: +5120:warning: +6140:warning: +6220--:warning: +5000
NetworkClientSecure/examples/WiFiClientInsecure:warning: +2000:warning: +2000:warning: +294:warning: +16:warning: +2880--:warning: +2040
NetworkClientSecure/examples/WiFiClientPSK:warning: +188:green_heart: -16:warning: +2000:warning: +2840:warning: +2820--:warning: +2080
NetworkClientSecure/examples/WiFiClientSecure:warning: +1920:warning: +2000:warning: +2820:warning: +2800--:warning: +2080
NetworkClientSecure/examples/WiFiClientSecureEnterprise:warning: +2080:warning: +2000:warning: +2780:warning: +2800--:warning: +1920
NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade:warning: +2040:warning: +2040:warning: +294:warning: +16:warning: +2880--:warning: +1880
NetworkClientSecure/examples/WiFiClientShowPeerCredentials:warning: +2080:warning: +1960:warning: +2840:warning: +2980--:warning: +1800
NetworkClientSecure/examples/WiFiClientTrustOnFirstUse:warning: +1880:warning: +2120:warning: +296:warning: +16:warning: +288:warning: +16--:warning: +1960
PPP/examples/PPP_Basic:warning: +32:green_heart: -16:warning: +400:warning: +1180:warning: +1140:warning: +1160:warning: +360
PPP/examples/PPP_WIFI_BRIDGE:warning: +5560:warning: +5440:warning: +6240:warning: +6240--:warning: +5680
WebServer/examples/AdvancedWebServer:warning: +2640:warning: +2520:warning: +352:warning: +16:warning: +3560--:warning: +2640
WebServer/examples/FSBrowser:warning: +2400:warning: +2600:warning: +3460:warning: +3480--:warning: +236:green_heart: -16
WebServer/examples/Filters:warning: +2680:warning: +2600:warning: +352:warning: +16:warning: +3560--:warning: +2560
WebServer/examples/HelloServer:warning: +2680:warning: +2520:warning: +352:warning: +16:warning: +3560--:warning: +2520
WebServer/examples/HttpAdvancedAuth:warning: +236:green_heart: -16:warning: +2720:warning: +3320:warning: +3440--:warning: +2600
WebServer/examples/HttpAuthCallback:warning: +2600:warning: +2720:warning: +3560:warning: +3560--:warning: +2560
WebServer/examples/HttpAuthCallbackInline:warning: +2560:warning: +2680:warning: +3520:warning: +3520--:warning: +2600
WebServer/examples/HttpBasicAuth:warning: +2600:warning: +2760:warning: +3500:warning: +3520--:warning: +2640
WebServer/examples/HttpBasicAuthSHA1:warning: +2680:warning: +2560:warning: +3520:warning: +3500--:warning: +2760
WebServer/examples/HttpBasicAuthSHA1orBearerToken:warning: +2520:warning: +2680:warning: +352:warning: +16:warning: +352:warning: +16--:warning: +2520
WebServer/examples/MultiHomedServers:warning: +2480:warning: +244:green_heart: -16:warning: +3520:warning: +3540--:warning: +2440
WebServer/examples/PathArgServer:warning: +360:warning: +160:warning: +1280:warning: +1360--:warning: +240
WebServer/examples/SDWebServer:warning: +248:green_heart: -16:warning: +2400:warning: +3460:warning: +3480--:warning: +236:green_heart: -16
WebServer/examples/SimpleAuthentification:warning: +2440:warning: +2480:warning: +3540:warning: +356:warning: +16--:warning: +2600
WebServer/examples/UploadHugeFile:warning: +400:warning: +400:warning: +1280:warning: +1360--:warning: +240
WebServer/examples/WebServer:warning: +2720:warning: +2520:warning: +3460:warning: +3480--:warning: +2520
WebServer/examples/WebUpdate:warning: +2560:warning: +2520:warning: +3560:warning: +3560--:warning: +2480
WiFi/examples/FTM/FTM_Initiator:warning: +480:warning: +400:warning: +1440:warning: +1520--:warning: +48:green_heart: -16
WiFi/examples/FTM/FTM_Responder:warning: +1760:warning: +1600:warning: +3040:warning: +3080--:warning: +1960
WiFi/examples/SimpleWiFiServer:warning: +2040:warning: +2000:warning: +292:warning: +16:warning: +2940--:warning: +1920
WiFi/examples/WPS:green_heart: -160:warning: +160:warning: +1180:warning: +1280--:green_heart: -280
WiFi/examples/WiFiAccessPoint:warning: +2040:warning: +1800:warning: +292:warning: +16:warning: +2940--:warning: +1880
WiFi/examples/WiFiBlueToothSwitch:warning: +2840--:warning: +4280:warning: +4300--:warning: +3160
WiFi/examples/WiFiClient:warning: +1960:warning: +2040:warning: +2740:warning: +2800--:warning: +1960
WiFi/examples/WiFiClientBasic:warning: +2080:warning: +2040:warning: +298:warning: +16:warning: +2920--:warning: +2120
WiFi/examples/WiFiClientConnect:warning: +2160:warning: +1680:warning: +3020:warning: +3040--:warning: +2000
WiFi/examples/WiFiClientEnterprise:warning: +2040:warning: +2120:warning: +2740:warning: +2900--:warning: +2080
WiFi/examples/WiFiClientEvents:warning: +1720:warning: +1680:warning: +3380:warning: +3500--:warning: +1760
WiFi/examples/WiFiClientStaticIP:warning: +1920:warning: +2200:warning: +2960:warning: +2900--:warning: +1960
WiFi/examples/WiFiExtender:green_heart: -320:green_heart: -360:warning: +1360:warning: +1380--:green_heart: -120
WiFi/examples/WiFiIPv6:warning: +3120:warning: +3080:warning: +4320:warning: +4420--:warning: +2720
WiFi/examples/WiFiMulti:warning: +1760:warning: +1720:warning: +298:warning: +16:warning: +2920--:warning: +2000
WiFi/examples/WiFiMultiAdvanced:warning: +2080:warning: +2000:warning: +2780:warning: +2920--:warning: +1760
WiFi/examples/WiFiScan:warning: +1720:warning: +1960:warning: +3040:warning: +3000--:warning: +1960
WiFi/examples/WiFiScanAsync:warning: +1840:warning: +1880:warning: +2980:warning: +2920--:warning: +1960
WiFi/examples/WiFiScanDualAntenna:warning: +1760:warning: +1720:warning: +2980:warning: +3040--:warning: +1960
WiFi/examples/WiFiScanTime:warning: +1640:warning: +1960:warning: +3000:warning: +2940--:warning: +1960
WiFi/examples/WiFiSmartConfig:warning: +2160:warning: +2040:warning: +3000:warning: +3060--:warning: +1920
WiFi/examples/WiFiTelnetToSerial:warning: +2040:warning: +1680:warning: +2980:warning: +3000--:warning: +2000
WiFi/examples/WiFiUDPClient:warning: +2960:warning: +2880:warning: +4180:warning: +4280--:warning: +2680
Ethernet/examples/ETH_LAN8720----------:warning: +2280
Ethernet/examples/ETH_TLK110----------:warning: +2280
me-no-dev commented 1 month ago

There are some spelling errors: https://github.com/espressif/arduino-esp32/actions/runs/11498055926/job/32003053726?pr=10376#step:8:25