ankraft / ACME-oneM2M-CSE

An open source CSE Middleware for Education.
https://acmecse.net/
BSD 3-Clause "New" or "Revised" License
23 stars 16 forks source link

[ASK] Redundant value check on announceUpdatedResource() #122

Closed samuelbles07 closed 11 months ago

samuelbles07 commented 11 months ago

Hi, hope you all well.

I wonder if it's on purpose to do this

announcedCSIs.append(csi)   # build a list of already announced CSIs
remoteRIs.append(csi)       # build a list of remote RIs

remoteRIs append csi value too, and doing non-announced check to both list even with the same value.

# Check for any non-announced csi in at, and possibly announce them 
    for csi in CSIsFromAnnounceTo:
        if csi not in announcedCSIs and csi not in remoteRIs:
            self.announceResourceToCSI(resource, csi)
ankraft commented 11 months ago

This really looks like some unnecessary duplicated work here. It could be that this is a left-over from some refactoring in the past. I will need to do some checkings whether this doesn't have some unintended side-effects and then remove it.

Good catch! Thank you for reporting this.

ankraft commented 11 months ago

Fixed in development version. Will be available with next release then.