Add mechanism to retry view population when pristine is locked

[?]
Jan 7, 2021, 12:18 AM
WBXOQKTZMWSXOFGAIBK2R2MGN5DXOQOQV7QPLVUIKFXWUYFXEFRAC

Dependencies

  • [2] VT237HUJ Add tree view for channels
  • [3] LL5PNIAB Add command for switching to a given channel
  • [4] HF3NERPZ Add cache for changes and add change dependencies to log
  • [5] L3VOQYAF Add changelog view to the source control panel

Change contents

  • replacement in src/views/channels.ts at line 43
    [2.1258][2.1258:1308]()
    return await this.repository.getChannels();
    [2.1258]
    [2.1308]
    let children;
    // Retry if the pristine is locked.
    while (!children) {
    try {
    children = await this.repository.getChannels();
    } catch (err) {
    if (!(err instanceof Error) || !err.message.includes('Pristine locked')) {
    throw err;
    }
    }
    }
    return children;
  • replacement in src/views/changelog.ts at line 49
    [3.1209][3.1209:1254]()
    return await this.repository.getLog();
    [3.1209]
    [3.1254]
    let children;
    // Retry if the pristine is locked. TODO: More robust solution
    while (!children) {
    try {
    children = await this.repository.getLog();
    } catch (err) {
    if (!(err instanceof Error) || !err.message.includes('Pristine locked')) {
    throw err;
    }
    }
    }
    return children;