Skip to content

🐞 [Bug]: Nothing calls clearStaleNodes anymore (maintenanceTimer was removed) #1491

Description

@compumike

Before submitting

  • I have searched existing issues to make sure this bug hasn't already been reported
  • I have updated to the latest version of the software to verify the issue still exists

Firmware Version

iOS 2.7.6 (but probably started earlier)

What did you do?

I noticed my node list was never shrinking. I searched the codebase to find what calls clearStaleNodes (defined in UpdateCoreData). Found no call sites!

Expected Behavior

Expected it would be called somewhere 😓

Current Behavior

No response

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

It looks like the maintenanceTimer which called clearStaleNodes was removed when BLEManager was removed in #1341 (2025-08-27):

https://github.com/meshtastic/Meshtastic-Apple/pull/1341/files#diff-a4bfb0bac704fbf4f688a8a51b3f99d1d786aa043b5b6d0507605cdff1a51ae4L90-L97

		// Run clearStaleNodes every hour
		maintenanceTimer = Timer.scheduledTimer(withTimeInterval: 3600, repeats: true, block: { _ in
			let result = clearStaleNodes(nodeExpireDays: Int(self.purgeStaleNodeDays), context: self.context)
			// If you are connected and the clear worked, pull nodes back from the node in case we have deleted anything from that app that is in the device nodedb
			if result && self.isSubscribed {
				self.sendWantConfig()
			}
		})

I'm not sure where it should live now, but probably somewhere? I'd happy to try making a PR, but would want @garthvh 's advice on where it would be best for the maintenanceTimer to live now that has easy access to all the relevant context?

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions