MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / clearForProfile

Method clearForProfile

src/utils/session-store.ts:100–124  ·  view source on GitHub ↗
(profile: string | null, keys?: (keyof SessionDefaults)[])

Source from the content-addressed store, hash-verified

98 }
99
100 clearForProfile(profile: string | null, keys?: (keyof SessionDefaults)[]): void {
101 if (keys == null) {
102 const wasActiveNamedProfile = profile !== null && profile === this.activeProfile;
103 this.clearAllForProfile(profile);
104 if (wasActiveNamedProfile) {
105 this.activeProfile = null;
106 log('info', '[Session] Active defaults profile reset to global');
107 }
108 return;
109 }
110
111 if (keys.length === 0) {
112 // No-op when an empty array is provided (e.g., empty UI selection)
113 log('info', '[Session] No keys provided to clear; no changes made');
114 return;
115 }
116
117 const next = this.getRawForProfile(profile);
118 for (const k of keys) delete next[k];
119
120 this.setDefaultsForResolvedProfile(profile, next);
121 this.revision += 1;
122 const profileLabel = this.getProfileLabel(profile);
123 log('info', `[Session] Defaults cleared (${profileLabel}): ${keys.join(', ')}`);
124 }
125
126 get<K extends keyof SessionDefaults>(key: K): SessionDefaults[K] {
127 return this.getAll()[key];

Callers 2

clearMethod · 0.95

Calls 5

clearAllForProfileMethod · 0.95
getRawForProfileMethod · 0.95
getProfileLabelMethod · 0.95
logFunction · 0.90

Tested by

no test coverage detected