Skip to content

Fix unlimited advert blob growth on ESP32 - #1495

Merged
ripplebiz merged 3 commits into
meshcore-dev:devfrom
oltaco:esp32-advblob-removal
Feb 1, 2026
Merged

Fix unlimited advert blob growth on ESP32#1495
ripplebiz merged 3 commits into
meshcore-dev:devfrom
oltaco:esp32-advblob-removal

Conversation

@oltaco

@oltaco oltaco commented Jan 27, 2026

Copy link
Copy Markdown
Member

This PR corrects ESP32 (and RP2040?) devices never removing old advert blobs, leading to the filesystem getting filled.

Changes:

  • new DataStore::deleteBlobByKey() function
  • tweaked onAdvertRecv() logic to only store advert blobs when adding/updating contacts.
  • new makeBlobPath inline helper for ESP32

Tested on Heltec V3 and confirmed that advert blobs are now removed on overwrite and when removing contacts via the app.
Tested on RAK4631 and confirmed no change in behaviour.

@oltaco
oltaco marked this pull request as draft January 27, 2026 07:47
@oltaco
oltaco force-pushed the esp32-advblob-removal branch from 1016c39 to 6287305 Compare January 27, 2026 07:53
@oltaco
oltaco marked this pull request as ready for review January 27, 2026 07:54
@oltaco

oltaco commented Jan 27, 2026

Copy link
Copy Markdown
Member Author

Thankfully @liamcottle noticed that putBlobByKey() wasn't being called in the update contact path. Fixed now.

@oltaco
oltaco force-pushed the esp32-advblob-removal branch from 6287305 to e93e12e Compare January 27, 2026 08:06
@oltaco

oltaco commented Jan 27, 2026

Copy link
Copy Markdown
Member Author

Now with added helper 👍

@liamcottle

Copy link
Copy Markdown
Member

Looks good thanks! Removed some duped code, and advert blobs shouldn't fill the filesystem anymore :)

Comment thread src/helpers/BaseChatMesh.h Outdated
// storage concepts, for sub-classes to override/implement
virtual int getBlobByKey(const uint8_t key[], int key_len, uint8_t dest_buf[]) { return 0; } // not implemented
virtual bool putBlobByKey(const uint8_t key[], int key_len, const uint8_t src_buf[], int len) { return false; }
virtual bool deleteBlobByKey(const uint8_t key[], int key_len) { return true; } // returns true even if blob did not exist

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is ever called?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I've removed that and force pushed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants