Skip to content

Commit

Permalink
[Synthetics] remove hydrating saved objects (#140545)
Browse files Browse the repository at this point in the history
* synthetics - remove hydrating saved objects

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* remove logic to set url back to empty string

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
dominiqueclarke and kibanamachine committed Sep 13, 2022
1 parent d9b7c3f commit 0ecd3fa
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 298 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
SyntheticsMonitorWithSecrets,
SyntheticsMonitor,
ConfigKey,
FormMonitorType,
} from '../../../common/runtime_types';
import { SyntheticsRestApiRouteFactory } from '../../legacy_uptime/routes/types';
import { API_URLS } from '../../../common/constants';
Expand Down Expand Up @@ -146,10 +145,7 @@ export const syncEditedMonitor = async ({
const editedSOPromise = savedObjectsClient.update<MonitorFields>(
syntheticsMonitorType,
previousMonitor.id,
monitorWithRevision.type === 'browser' &&
monitorWithRevision[ConfigKey.FORM_MONITOR_TYPE] !== FormMonitorType.SINGLE
? { ...monitorWithRevision, urls: '' }
: monitorWithRevision
monitorWithRevision
);

const editSyncPromise = syntheticsMonitorClient.editMonitor(
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ import {
HeartbeatConfig,
} from '../../common/runtime_types';
import { getServiceLocations } from './get_service_locations';
import { hydrateSavedObjects } from './hydrate_saved_object';
import { DecryptedSyntheticsMonitorSavedObject } from '../../common/types';

import { normalizeSecrets } from './utils/secrets';

Expand Down Expand Up @@ -475,14 +473,6 @@ export class SyntheticsService {
monitors: monitors.length,
});

if (this.indexTemplateExists) {
// without mapping, querying won't make sense
hydrateSavedObjects({
monitors: monitors as unknown as DecryptedSyntheticsMonitorSavedObject[],
server: this.server,
});
}

return (monitors ?? []).map((monitor) => {
const attributes = monitor.attributes as unknown as MonitorFields;
return formatHeartbeatRequest({
Expand Down

0 comments on commit 0ecd3fa

Please sign in to comment.