Skip to content

Commit

Permalink
update offline default max in storage time (#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlie-777 authored Jul 27, 2024
1 parent 5929dcc commit 1890d61
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class OfflineDbProviderTests extends AITestClass {
let expectedStorageKey = "AIOffline_1_dc.services.visualstudio.com";
Assert.equal(ctx[0], expectedStorageKey, "should have expected storage");
Assert.equal(ctx[1], "dc.services.visualstudio.com", "default endpoint is set");
let expectedMaxStorageTime = 10080000;
let expectedMaxStorageTime = 604800000;
Assert.equal(ctx[2], expectedMaxStorageTime, "default Max time is set");
Assert.ok(!provider.supportsSyncRequests(), "support sync should be set to false");
// this test will run database creation/dbupgrade as well
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ export interface IOfflineChannelConfiguration {

/**
* [Optional] Identifies the maximum time in ms that items should be in persistent storage.
* default: 10080000 (around 7days)
* default: 10080000 (around 2.8 hours) for versions <= 3.3.0
* default: 604800000 (around 7days) for versions > 3.3.0
*/
inStorageMaxTime?: number;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { IndexedDbHelper } from "./IndexDbHelper";
//TODO: move all const to one file
const EventsToDropAtOneTime = 10; // If we fail to add a new event this is the max number of events we will attempt to remove to make space
const StoreVersion = 1; // The Current version for the stored items, this will be used in the future for versioning
const OrhpanedEventThresholdInMs = 10080000; // 7 days
const OrhpanedEventThresholdInMs = 604800000; // 7 days
const UnknowniKey = "Unknown";
const ErrorMessageUnableToAddEvent = "DBError: Unable to add event";
const MaxCriticalEvtsDropCnt = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Version = "1";
const DefaultStorageKey = "AIOffline";
const DefaultMaxStorageSizeInBytes = 5000000;
const MaxCriticalEvtsDropCnt = 2;
const DefaultMaxInStorageTime = 10080000; //7*24*60*60*1000 7days
const DefaultMaxInStorageTime = 604800000; //7*24*60*60*1000 7days
// [Optional for version 1]: TODO: order event by time

interface IJsonStoreDetails {
Expand Down

0 comments on commit 1890d61

Please sign in to comment.