mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-02-25 11:55:27 +00:00
Compare commits
2 Commits
fix_duplic
...
users/saks
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27f850fc02 | ||
|
|
5832170b2b |
@@ -395,6 +395,14 @@ describe("CopyJobUtils", () => {
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false for different completion percentage", () => {
|
||||
const jobs1 = [createMockJob("job1", "Running")];
|
||||
const jobs2 = [{ ...createMockJob("job1", "Running"), CompletionPercentage: 75 }];
|
||||
|
||||
const result = CopyJobUtils.isEqual(jobs1, jobs2);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("should return true for empty arrays", () => {
|
||||
const result = CopyJobUtils.isEqual([], []);
|
||||
expect(result).toBe(true);
|
||||
|
||||
@@ -142,7 +142,7 @@ export function isEqual(prevJobs: CopyJobType[], newJobs: CopyJobType[]): boolea
|
||||
if (!newJob) {
|
||||
return false;
|
||||
}
|
||||
return prevJob.Status === newJob.Status;
|
||||
return prevJob.Status === newJob.Status && prevJob.CompletionPercentage === newJob.CompletionPercentage;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export class ContainerSampleGenerator {
|
||||
? await createMongoDocument(collection.databaseId, collection, shardKey, doc)
|
||||
: await createDocument(collection, doc);
|
||||
} catch (error) {
|
||||
NotificationConsoleUtils.logConsoleError(error);
|
||||
NotificationConsoleUtils.logConsoleError(error instanceof Error ? error.message : String(error));
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -329,7 +329,10 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
}
|
||||
|
||||
private static extractHeaderStatus(consoleData: ConsoleData) {
|
||||
return consoleData?.message.split(":\n")[0];
|
||||
if (!consoleData?.message || typeof consoleData.message !== "string") {
|
||||
return undefined;
|
||||
}
|
||||
return consoleData.message.split(":\n")[0];
|
||||
}
|
||||
|
||||
private onConsoleWasExpanded = (): void => {
|
||||
|
||||
@@ -37,7 +37,7 @@ const requestFabricToken = async (): Promise<void> => {
|
||||
|
||||
scheduleRefreshFabricToken();
|
||||
} catch (error) {
|
||||
logConsoleError(error as string);
|
||||
logConsoleError(error instanceof Error ? error.message : String(error));
|
||||
throw error;
|
||||
} finally {
|
||||
lastRequestTimestamp = undefined;
|
||||
|
||||
Reference in New Issue
Block a user