Fixed two issues #2053 and #2202 (#2203)

* Fixed two issues #2053 and #2202

* Updated changelog, updated versions

* Updated core version
main
Boris Sekachev 5 years ago committed by GitHub
parent 8330015ac5
commit a93b4607c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed Data is not getting cleared, even after deleting the Task from Django Admin App(<https://github.com/openvinotoolkit/cvat/issues/1925>)
- Fixed blinking message: "Some tasks have not been showed because they do not have any data" (<https://github.com/openvinotoolkit/cvat/pull/2200>)
- Fixed case when a task with 0 jobs is shown as "Completed" in UI (<https://github.com/openvinotoolkit/cvat/pull/2200>)
- Fixed use case when UI throws exception: Cannot read property 'objectType' of undefined #2053 (<https://github.com/openvinotoolkit/cvat/pull/2203>)
- Fixed use case when logs could be saved twice or more times #2202 (<https://github.com/openvinotoolkit/cvat/pull/2203>)
### Security
-

@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "3.7.0",
"version": "3.7.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "3.7.0",
"version": "3.7.1",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {

@ -196,7 +196,7 @@ class LogWithExceptionInfo extends Log {
dump() {
let body = super.dump();
const payload = body.payload;
const { payload } = body;
const client = detect();
body = {
...body,

@ -14,6 +14,12 @@ const { LogType } = require('./enums');
const WORKING_TIME_THRESHOLD = 100000; // ms, 1.66 min
function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
class LoggerStorage {
constructor() {
this.clientID = Date.now().toString().substr(-6);
@ -22,6 +28,7 @@ class LoggerStorage {
this.collection = [];
this.ignoreRules = {}; // by event
this.isActiveChecker = null;
this.saving = false;
this.ignoreRules[LogType.zoomImage] = {
lastLog: null,
@ -146,6 +153,10 @@ LoggerStorage.prototype.log.implementation = function (logType, payload, wait) {
};
LoggerStorage.prototype.save.implementation = async function () {
while (this.saving) {
await sleep(100);
}
const collectionToSend = [...this.collection];
const lastLog = this.collection[this.collection.length - 1];
@ -164,14 +175,18 @@ LoggerStorage.prototype.save.implementation = async function () {
const userActivityLog = logFactory(LogType.sendUserActivity, logPayload);
collectionToSend.push(userActivityLog);
await serverProxy.logs.save(collectionToSend.map((log) => log.dump()));
for (const rule of Object.values(this.ignoreRules)) {
rule.lastLog = null;
try {
this.saving = true;
await serverProxy.logs.save(collectionToSend.map((log) => log.dump()));
for (const rule of Object.values(this.ignoreRules)) {
rule.lastLog = null;
}
this.collection = [];
this.workingTime = 0;
this.lastLogTime = Date.now();
} finally {
this.saving = false;
}
this.collection = [];
this.workingTime = 0;
this.lastLogTime = Date.now();
};
module.exports = new LoggerStorage();

@ -1001,7 +1001,7 @@ export function getJobAsync(
export function saveAnnotationsAsync(sessionInstance: any):
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const { filters, frame, showAllInterpolationTracks } = receiveAnnotationsParameters();
const { filters, showAllInterpolationTracks } = receiveAnnotationsParameters();
dispatch({
type: AnnotationActionTypes.SAVE_ANNOTATIONS,
@ -1021,9 +1021,6 @@ ThunkAction {
},
});
});
const states = await sessionInstance
.annotations.get(frame, showAllInterpolationTracks, filters);
await saveJobEvent.close();
await sessionInstance.logger.log(
LogType.sendTaskInfo,
@ -1031,6 +1028,10 @@ ThunkAction {
);
dispatch(saveLogsAsync());
const { frame } = receiveAnnotationsParameters();
const states = await sessionInstance
.annotations.get(frame, showAllInterpolationTracks, filters);
dispatch({
type: AnnotationActionTypes.SAVE_ANNOTATIONS_SUCCESS,
payload: {

Loading…
Cancel
Save