MCPcopy Create free account
hub / github.com/CommE2E/comm / handleStateCheckConditionsUpdate

Method handleStateCheckConditionsUpdate

keyserver/src/socket/socket.js:719–741  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

717 }
718
719 handleStateCheckConditionsUpdate() {
720 if (!this.stateCheckCanStart) {
721 this.clearStateCheckTimeout();
722 return;
723 }
724 if (this.stateCheckTimeoutID) {
725 return;
726 }
727 const { viewer } = this;
728 if (!viewer) {
729 return;
730 }
731 const timeUntilStateCheck =
732 viewer.sessionLastValidated + sessionCheckFrequency - Date.now();
733 if (timeUntilStateCheck <= 0) {
734 ignorePromiseRejections(this.initiateStateCheck());
735 } else {
736 this.stateCheckTimeoutID = setTimeout(
737 this.initiateStateCheck,
738 timeUntilStateCheck,
739 );
740 }
741 }
742
743 initiateStateCheck = async () => {
744 this.setStateCheckConditions({ stateCheckOngoing: true });

Callers 2

Calls 2

ignorePromiseRejectionsFunction · 0.90

Tested by

no test coverage detected