General questions

Answered

about blue cloud mark

Hello Olivier,


I'm Jhon Breith, who asked a question on "about cloud mark" about two years ago.


I tried all the methods you taught me in the previous "about cloud mark", but even now, if I leave it for a certain period of time (about 30s to 1min) without writing anything, a blue cloud with a slanted line appears. I'm in trouble.

The content of the question overlaps with the previous one, but is it possible to prevent the blue cloud with a hatched mark from being displayed even if I leave it without writing anything?


Best Answer

Dear Gwenaëlle,


I checked again, but the cloud mark is still displayed.

It appeared in about 150s when nothing was written, and in about 350s when some text was written.


Line 161 of  "/src/recognizer/RecognizerService.js"  is as follows as you told me.

if (

     (editorRef.error.innerText === Constants.Error.TOO_OLD || err.reason === 'CLOSE_RECOGNIZER') &&

     RecognizerContext.canReconnect(editor.recognizerContext) || editorRef.error.innerText === Constants.Error.NO_ACTIVITY

   ) {

     logger.info('Reconnection is available', err)

     editorRef.error.style.display = 'none'

   } else {

     editorRef.loader.style.display = 'none'

     editorRef.error.style.display = 'initial'

     emitEvents(editor, err, Constants.EventType.ERROR, ...events)

   }


Is there anything wrong with that?

What should I do now...

Thank you very much.


Hello John,


Thank you for contacting us.

I guess that you are using iinkJS with the WebSocket mode.

After a given period of time of inactivity, ( 5 minutes if case there is no actovoty, and 3 minutes if there are no exchanges since last writing), the web session is closed.

At that moment the blue cloud is displayed with a 'Session closed due to no activity.' text message.

I guess this is what you observe.


If you don't want to display this blue cloud with the text error message, you can customize the handleError of the RecognizerService.js (https://github.com/MyScript/iinkJS/blob/master/src/recognizer/RecognizerService.js)  to filter this error code and not display anything is that case. this can be done by modify the block starting line 161 by following block:


  if (
    (editorRef.error.innerText === Constants.Error.TOO_OLD || err.reason === 'CLOSE_RECOGNIZER') &&
    RecognizerContext.canReconnect(editor.recognizerContext) || editorRef.error.innerText === Constants.Error.NO_ACTIVITY
  ) {
    logger.info('Reconnection is available', err)
    editorRef.error.style.display = 'none'
  }



Best regards,


Gwenaëlle

Dear Gwenaëlle,


I updated iinkJS to the latest version and edited RecognizerService.js as you taught me.

The blue cloud mark no longer appears when something is written, but it will still be displayed when nothing is written.

Is it possible to prevent this mark message from being displayed even when nothing is written?


Also on the console screen

Error while firing the recognition {type: 'error', message: 'Session closed due to no activity.', code: 'no.activity'}

or

RecognizerService.js:119 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type')

     at handleError (RecognizerService.js:119:11)

     at responseCallback (iinkWsRecognizer.js:270:10)

     at _callee4$ (iinkWsRecognizer.js:466:7)

     at tryCatch (runtime.js:45:40)

     at Generator.invoke [as _invoke] (runtime.js:274:22)

     at forEach.n.<computed> [as next] (runtime.js:97:21)

     at asyncGeneratorStep (asyncToGenerator.js:3:20)

     at _next (asyncToGenerator.js:25:9)

I'm getting an error message like this.


Thank you very much.

When I checked again, it seems that the mark message appears even if the characters are written.

What should I do…

Hi John,


Thank you for contacting us.

Could you please double check?

Indeed, after applying the same code update on top of latest iinkJS, as the one already shared with you, I don't have the blue cloud anymore.


Best regards


Gwenaëlle

Answer

Dear Gwenaëlle,


I checked again, but the cloud mark is still displayed.

It appeared in about 150s when nothing was written, and in about 350s when some text was written.


Line 161 of  "/src/recognizer/RecognizerService.js"  is as follows as you told me.

if (

     (editorRef.error.innerText === Constants.Error.TOO_OLD || err.reason === 'CLOSE_RECOGNIZER') &&

     RecognizerContext.canReconnect(editor.recognizerContext) || editorRef.error.innerText === Constants.Error.NO_ACTIVITY

   ) {

     logger.info('Reconnection is available', err)

     editorRef.error.style.display = 'none'

   } else {

     editorRef.loader.style.display = 'none'

     editorRef.error.style.display = 'initial'

     emitEvents(editor, err, Constants.EventType.ERROR, ...events)

   }


Is there anything wrong with that?

What should I do now...

Thank you very much.