Closed edpaget closed 10 years ago
So I added a console.trace; console.log(Subject.instances.map((s) -> s.zooniverse_id))
to the Subject constructor when I was testing. After each classification, the Subject constructor was being called, as expected, from its child class SubjectForRecent, but the subject it was being called was being added to back into the Subject.instances array.
Adding a console.log(@constructor)
to the BaseModel constructor confirmed that, at least in Firefox, the Subject object that had been passed to SubjectFromRecent still had this.constructor
as Subject. And my console.log(Subject.instances.map((s) -> s.zooniverse_id))
confirmed that it was being added back to the Subject.instances array.
Bizarre. I can't duplicate that behavior here. Want to just point Asteroid Zoo at this commit until we can figure out why it's doing this?
I think hard coding the keys in a subject is going to break the new Planet Hunters, where subjects come back with non-standard keys.
Maybe pass in JSON.parse JSON.stringify subject
?
Eh, I want to look at this more tomorrow.
Yeah I was thinking of using json parsing as well.I'll switch to that then point Asteroid at it.
It could just be something weird happening in asteroid zoo. Although I was seeing complaints about duplicates on the Condor Watch talk, which I think also uses this version of the library. On Jun 25, 2014 8:28 AM, "Brian Carstensen" notifications@github.com wrote:
Bizarre. I can't duplicate that behavior here. Want to just point Asteroid Zoo at this commit until we can figure out why it's doing this?
I think hard coding the keys in a subject is going to break the new Planet Hunters, where subjects come back with non-standard keys.
Maybe pass in JSON.parse JSON.stringify subject?
Eh, I want to look at this more tomorrow.
— Reply to this email directly or view it on GitHub https://github.com/zooniverse/Zooniverse/pull/38#issuecomment-47100315.
@aweiksnar and I confirmed that the same behaviour happens for him in Chrome on OS X as well.
Prevents duplicate subjects from being shown, by making sure destroyed subjects aren't readded to the subject queue when they're made into a recent