It's nothing to do with savedvariables - I've seen a similar issue in 2 addons and the table is only a 'savedvariable' in one of those addons so...
It's not behaviour before VARIABLES_LOADED either - this is something you can see after you've been playing for HOURS
Furthermore - 2 users have reported bugs which could ONLY be caused by a table not being completely emptied - so it's not just me
The addon in question resets it's table VERY often - and yet we see 'weirdness' which goes away after a "/console reloadui" and the ONLY thing that would do is 'properly' clear the tables.
I think the issue is with tables WITHIN tables - and it may be down to my ignorance of how this should work of course.
It's not an easy bug to reproduce - there seems to be a specific set of circumstances (most likely related to being in/out of combat) but what I seem to be seeing is
fred['a'] = {}
fred ['a']['a'] = 1
fred ['a']['b'] = 1
fred ['a']['c'] = 1
fred = {}
fred['a'] = {}
fred ['a']['a'] = 1
At this point fred ['a']['b'] == 1
If, instead of using fred = {} I do something like
for v in pairs(fred) do
fred[v] = {}
end
I never see the issue - so that's what my addons do to clear tables right now. If I ever went to a 3rd level of 'nesting' I guess I'd have to reset both levels - and so on...