Closed briandowns closed 1 year ago
This is interesting, do you have an example source file I can try?
I have a very specific code base that this was observed in but I'll get something together to demonstrate. Apologies. I should have included an example.
It's all good! Yeah, if you can piece together something where you can reproduce that would be incredibly helpful, thank you
The relevant code is the last
method in this class.
@Controller("/api/v1/releases")
class Releases {
private dataStore;
init(dataStore) {
this.dataStore = dataStore;
}
@Post
new(request) {
if (request.query.exists("id")) {
const key = request.query.get("id");
return {
key: this.dataStore.get(key)
};
}
return [this.dataStore];
}
@Get
@Cache(10)
retrieve(request) {
if (request.query.exists("id")) {
const key = request.query.get("id");
return {
key: this.dataStore.get(key)
};
}
return [this.dataStore];
}
@Get
@Path("/last")
last(request) {
const keys = this.dataStore.keys();
const idx = this.dataStore.len()-1;
const lastKey = keys[idx];
return JsonResponse({lastKey: this.dataStore.get(lastKey)});
}
}
print(Releases.methodAnnotations);
Results:
{"new": {"Post": nil}, "retrieve": {"Cache": 10, "Get": nil}, "__annotatedMethodName": {"Path": "/last", "Get": nil}}
I think it may actually be to do with dictDelete. Removing that call seems to have all the methods along with the placeholder
Okay yeah, it's the dictSet. The robinhood hashing is moving entries about so entry->key
now points at something else. Should be resolvable
Is there an existing issue for this?
Current Behavior
I haven't been able to determine a cause yet but on Linux systems, occasionally a method with annotations will complete parsing incorrectly. The
__annotatedMethod
placeholder isn't always replaced with the method name.Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response