We want to make sure the app is using the latest configuration from the server if the app or sdk version changes.
515842
private void invalidateCaches(Conversation conversation) {
		checkConversationQueue();

		conversation.setInteractionExpiration(0L);
		Configuration config = Configuration.load();
		config.setConfigurationCacheExpirationMillis(System.currentTimeMillis());
		config.save();
	}
991497
public boolean checkAndMaybeUpdate() throws IOException {
    try {
      File nativeLibDir = soSource.soDirectory;
      Context updatedContext =
          applicationContext.createPackageContext(applicationContext.getPackageName(), 0);
      File updatedNativeLibDir = new File(updatedContext.getApplicationInfo().nativeLibraryDir);
      if (!nativeLibDir.equals(updatedNativeLibDir)) {
        Log.d(
            SoLoader.TAG,
            "Native library directory updated from " + nativeLibDir + " to " + updatedNativeLibDir);
        // update flags to resolve dependencies since the system does not properly resolve
        // dependencies when the location has moved
        flags |= DirectorySoSource.RESOLVE_DEPENDENCIES;
        soSource = new DirectorySoSource(updatedNativeLibDir, flags);
        soSource.prepare(flags);
        applicationContext = updatedContext;
        return true;
      }
      return false;
    } catch (PackageManager.NameNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
1309070
def is_outdated(self):
        """"""
        if self.args.disable_check_update:
            # Check is disabled by configuration
            return False

        logger.debug("Check Glances version (installed: {} / latest: {})".format(self.installed_version(), self.latest_version()))
        return LooseVersion(self.latest_version()) > LooseVersion(self.installed_version())
219409
def checkVersion(self):
        """"""

        r = self.doQuery('version')

        if r.status_code == 200:  # Query ok ?
            data = r.json()

            if data['result'] == 'Ok' and data['version'] == self.PI_API_VERSION and data['protocol'] == self.PI_API_NAME:
                return True
        return False
1370448
function handleSuccess() {
  clearOutdatedErrors();

  var isHotUpdate = !isFirstCompilation;
  isFirstCompilation = false;
  hasCompileErrors = false;

  // Attempt to apply hot updates or reload.
  if (isHotUpdate) {
    tryApplyUpdates(function onHotUpdateSuccess() {
      // Only dismiss it when we're sure it's a hot update.
      // Otherwise it would flicker right before the reload.
      tryDismissErrorOverlay();
    });
  }
}
1288233
@Override
    public boolean statusUpdate(final String appName, final String id,
                                final InstanceStatus newStatus, String lastDirtyTimestamp,
                                final boolean isReplication) {
        if (super.statusUpdate(appName, id, newStatus, lastDirtyTimestamp, isReplication)) {
            replicateToPeers(Action.StatusUpdate, appName, id, null, newStatus, isReplication);
            return true;
        }
        return false;
    }
1006545
private static boolean validateVersion(Context ctx, ChangeLog clog){

        // Get Preferences
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
        int lastSeen = prefs.getInt(PREF_CHANGELOG_LAST_SEEN, -1);

        // Second sort versions by it's code
        int latest = Integer.MIN_VALUE;
        for(Version version: clog.versions){
            if(version.code > latest){
                latest = version.code;
            }
        }

        // Get applications current version
        if(latest > lastSeen){
            if(!BuildConfig.DEBUG) prefs.edit().putInt(PREF_CHANGELOG_LAST_SEEN, latest).apply();
            return true;
        }

        return false;
    }
913781
def check_version():
    """"""
    # Retrieve version info
    res = requests.get("https://cs50.me/versions/submit50")  # TODO change this to submit50.io!
    if res.status_code != 200:
        raise Error(_("You have an unknown version of submit50. "
                      "Email sysadmins@cs50.harvard.edu!"))

    # Check that latest version == version installed
    required_required = pkg_resources.parse_version(res.text.strip())
772005
def do_version():
    """"""
    v = ApiPool.ping.model.Version(
        name=ApiPool().current_server_name,
        version=ApiPool().current_server_api.get_version(),
        container=get_container_version(),
    )
    log.info("/version: " + pprint.pformat(v))
    return v
805638
def check_if_ok_to_update(self):
        """"""
        current_time = int(time.time())
        last_refresh = self.last_refresh
        if last_refresh is None:
            last_refresh = 0
        if current_time >= (last_refresh + self.refresh_rate):
            return True
        return False
354797
def _in_version(self, *versions):
        ""
        for version in versions:
            if (self._version == version
                or (isinstance(self._version, collections.Container) 
                    and version in self._version)):
                return True
        return False
357309
def version_check(self):
        
        try:
            version_info = self['Version']
        except KeyError:
            raise ValidateError('Config file has to have a Version section')
        try:
            float(version_info['version'])
        except KeyError:
            raise ValidateError('Config file has to have a version section')
        except ValueError:
            raise ValidateError('Version has to be a float.')
        
        try:
            version_info['name']
        except KeyError:
            raise ValidateError("Config file has to have a name")
        return
679848
def _update_version(app_name, version, app_spec, try_update=True):
    
    if not try_update:
        return None
    try:
        app_id = dxpy.api.app_update("app-" + app_name, version, app_spec)["id"]
        return app_id
    except dxpy.exceptions.DXAPIError as e:
        if e.name == 'InvalidState':
            print('App %s/%s has already been published' % (app_spec["name"], version), file=sys.stderr)
            return None
        raise e
1169108
def verify_helper_is_current
      return if Snapshot.config[:skip_helper_version_check]
      current_version = version_of_bundled_helper
      UI.verbose("Checking that helper files contain #{current_version}")

      helper_files = Update.find_helper
      if helper_files.empty?
        UI.error("Your Snapshot Helper file is missing, please place a copy")
        UI.error("in your project directory")
        UI.message("More information about Snapshot setup can be found here:")
        UI.message("https://docs.fastlane.tools/actions/snapshot/#quick-start")
        UI.user_error!("Please add a Snapshot Helper file to your project")
        return
      end

      helper_files.each do |path|
        content = File.read(path)

        unless content.include?(current_version)
          UI.error("Your '#{path}' is outdated, please run `fastlane snapshot update`")
          UI.error("to update your Helper file")
          UI.user_error!("Please update your Snapshot Helper file using `fastlane snapshot update`")
        end
      end
    end
1055448
private boolean checkDatabaseVersion(String databaseName) {
        final Version softwareVersion = this.requiredProductVersions.get(databaseName);
        if (softwareVersion == null) {
            throw new IllegalStateException("No version number is configured for: " + databaseName);
        }

        final Version databaseVersion = this.versionDao.getVersion(databaseName);
        if (databaseVersion == null) {
            throw new IllegalStateException(
                    "No version number is exists in the database for: " + databaseName);
        }

        return softwareVersion.equals(databaseVersion);
    }
85599
async function checkNewVersion() {
    try {
        const file = path.join(constants.GLOBAL_DIR, constants.GLOBAL_INFO);

        // If it does not exist, create it.
        if (!fs.existsSync(file)) {
            createFile({
                name: file,
                source: `{"lastCheckForUpdate": 0}\n`,
            });
        }

        // Read info file
        const json = fs.readJsonSync(file, 'utf8');
        const lastCheckForUpdate = json.lastCheckForUpdate;

        // Show update message
        if (lastCheckForUpdate + (6 * 3600 * 1000) < Date.now()) {
            const latestVersion = await request(`${constants.FIREBASE_DATABASE_URL}/version/cli/latest.json`);
            if (latestVersion && latestVersion !== 'null' && latestVersion !== `"${pjson.version}"`) {
                const scale = pjson.version.length + latestVersion.length - 10;

                console.log();
                console.log(`${`   ┏`.yellow}${`─`.repeat(scale + 45).yellow}${`┓`.yellow}`);
                console.log(`${`   │`.yellow}${` `.repeat(scale + 45)}${`│`.yellow}`);
                console.log(`${`   │`.yellow}${`      Update available ${pjson.version} -> `}${`${latestVersion}`.green}${`        │`.yellow}`);
                console.log(`${`   │`.yellow}${`  Run `}${`npm i -g google-apps-script`.red}${` to update`}${` `.repeat(scale + 2)}${`│`.yellow}`);
                console.log(`${`   │`.yellow}${` `.repeat(scale + 45)}${`│`.yellow}`);
                console.log(`${`   ┗`.yellow}${`─`.repeat(scale + 45).yellow}${`┛`.yellow}`);
                console.log();
            }

            // Update lastCheckForUpdate
            json.lastCheckForUpdate = Date.now();
            createFile({
                name: file,
                source: JSON.stringify(json),
            });
            return true;
        }
        return false;
    } catch (err) {
        err.origin = 'checkNewVersion';
        await error.log(err);
        return false;
    }
}
5257
def _check_update_(self):
        """"""
        try:
            data = requests.get("https://pypi.python.org/pypi/jira/json", timeout=2.001).json()

            released_version = data['info']['version']
            if parse_version(released_version) > parse_version(__version__):
                warnings.warn(
                    "You are running an outdated version of JIRA Python %s. Current version is %s. Do not file any bugs against older versions." % (
                        __version__, released_version))
        except requests.RequestException:
            pass
        except Exception as e:
            logging.warning(e)