Skip to content

Commit 4b6685e

Browse files
committed
Fix broken download graphs
Fix the following assertion error that occurs when running the frontend in debug mode, which cause graphs to not display at all. > Assertion Failed: You must include an 'id' for version-download in an > object passed to 'push' This has been happening since 3c92ca2 landed. The fix involves telling Ember how to create a unique ID for a version-download object, using the composite key. I haven't been able to confirm, but I believe this is the reason that graphs in production are only ever counting/displaying a single version. When using this change locally in debug mode against the live website, the downloads graphs are rendering correctly. Fixes #1704.
1 parent cfe6e08 commit 4b6685e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/serializers/version-download.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import DS from 'ember-data';
2+
3+
export default DS.RESTSerializer.extend({
4+
extractId(modelClass, resourceHash) {
5+
return `${resourceHash.date}-${resourceHash.version}`;
6+
},
7+
});

0 commit comments

Comments
 (0)