forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_server.rs
More file actions
774 lines (680 loc) · 19.7 KB
/
code_server.rs
File metadata and controls
774 lines (680 loc) · 19.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
use super::paths::{InstalledServer, LastUsedServers, ServerPaths};
use crate::constants::{APPLICATION_NAME, QUALITYLESS_PRODUCT_NAME, QUALITYLESS_SERVER_NAME};
use crate::options::{Quality, TelemetryLevel};
use crate::state::LauncherPaths;
use crate::update_service::{
unzip_downloaded_release, Platform, Release, TargetKind, UpdateService,
};
use crate::util::command::{capture_command, kill_tree};
use crate::util::errors::{
wrap, AnyError, ExtensionInstallFailed, MissingEntrypointError, WrappedError,
};
use crate::util::http::{self, SimpleHttp};
use crate::util::io::SilentCopyProgress;
use crate::util::machine::process_exists;
use crate::{debug, info, log, span, spanf, trace, warning};
use lazy_static::lazy_static;
use opentelemetry::KeyValue;
use regex::Regex;
use serde::Deserialize;
use std::fs;
use std::fs::File;
use std::io::{ErrorKind, Write};
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::Duration;
use tokio::fs::remove_file;
use tokio::io::{AsyncBufReadExt, BufReader};
use tokio::process::{Child, Command};
use tokio::sync::oneshot::Receiver;
use tokio::time::{interval, timeout};
use uuid::Uuid;
lazy_static! {
static ref LISTENING_PORT_RE: Regex =
Regex::new(r"Extension host agent listening on (.+)").unwrap();
static ref WEB_UI_RE: Regex = Regex::new(r"Web UI available at (.+)").unwrap();
}
const MAX_RETAINED_SERVERS: usize = 5;
#[derive(Clone, Debug, Default)]
pub struct CodeServerArgs {
pub host: Option<String>,
pub port: Option<u16>,
pub socket_path: Option<String>,
// common argument
pub telemetry_level: Option<TelemetryLevel>,
pub log: Option<log::Level>,
pub accept_server_license_terms: bool,
pub verbose: bool,
// extension management
pub install_extensions: Vec<String>,
pub uninstall_extensions: Vec<String>,
pub list_extensions: bool,
pub show_versions: bool,
pub category: Option<String>,
pub pre_release: bool,
pub force: bool,
pub start_server: bool,
// connection tokens
pub connection_token: Option<String>,
pub connection_token_file: Option<String>,
pub without_connection_token: bool,
}
impl CodeServerArgs {
pub fn log_level(&self) -> log::Level {
if self.verbose {
log::Level::Trace
} else {
self.log.unwrap_or(log::Level::Info)
}
}
pub fn telemetry_disabled(&self) -> bool {
self.telemetry_level == Some(TelemetryLevel::Off)
}
pub fn command_arguments(&self) -> Vec<String> {
let mut args = Vec::new();
if let Some(i) = &self.socket_path {
args.push(format!("--socket-path={}", i));
} else {
if let Some(i) = &self.host {
args.push(format!("--host={}", i));
}
if let Some(i) = &self.port {
args.push(format!("--port={}", i));
}
}
if let Some(i) = &self.connection_token {
args.push(format!("--connection-token={}", i));
}
if let Some(i) = &self.connection_token_file {
args.push(format!("--connection-token-file={}", i));
}
if self.without_connection_token {
args.push(String::from("--without-connection-token"));
}
if self.accept_server_license_terms {
args.push(String::from("--accept-server-license-terms"));
}
if let Some(i) = self.telemetry_level {
args.push(format!("--telemetry-level={}", i));
}
if let Some(i) = self.log {
args.push(format!("--log={}", i));
}
for extension in &self.install_extensions {
args.push(format!("--install-extension={}", extension));
}
if !&self.install_extensions.is_empty() {
if self.pre_release {
args.push(String::from("--pre-release"));
}
if self.force {
args.push(String::from("--force"));
}
}
for extension in &self.uninstall_extensions {
args.push(format!("--uninstall-extension={}", extension));
}
if self.list_extensions {
args.push(String::from("--list-extensions"));
if self.show_versions {
args.push(String::from("--show-versions"));
}
if let Some(i) = &self.category {
args.push(format!("--category={}", i));
}
}
if self.start_server {
args.push(String::from("--start-server"));
}
args
}
}
/// Base server params that can be `resolve()`d to a `ResolvedServerParams`.
/// Doing so fetches additional information like a commit ID if previously
/// unspecified.
pub struct ServerParamsRaw {
pub commit_id: Option<String>,
pub quality: Quality,
pub code_server_args: CodeServerArgs,
pub headless: bool,
pub platform: Platform,
}
/// Server params that can be used to start a VS Code server.
pub struct ResolvedServerParams {
pub release: Release,
pub code_server_args: CodeServerArgs,
}
impl ResolvedServerParams {
fn as_installed_server(&self) -> InstalledServer {
InstalledServer {
commit: self.release.commit.clone(),
quality: self.release.quality,
headless: self.release.target == TargetKind::Server,
}
}
}
impl ServerParamsRaw {
pub async fn resolve(
self,
log: &log::Logger,
http: impl SimpleHttp + Send + Sync + 'static,
) -> Result<ResolvedServerParams, AnyError> {
Ok(ResolvedServerParams {
release: self.get_or_fetch_commit_id(log, http).await?,
code_server_args: self.code_server_args,
})
}
async fn get_or_fetch_commit_id(
&self,
log: &log::Logger,
http: impl SimpleHttp + Send + Sync + 'static,
) -> Result<Release, AnyError> {
let target = match self.headless {
true => TargetKind::Server,
false => TargetKind::Web,
};
if let Some(c) = &self.commit_id {
return Ok(Release {
commit: c.clone(),
quality: self.quality,
target,
name: String::new(),
platform: self.platform,
});
}
UpdateService::new(log.clone(), http)
.get_latest_commit(self.platform, target, self.quality)
.await
}
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
#[allow(dead_code)]
struct UpdateServerVersion {
pub name: String,
pub version: String,
pub product_version: String,
pub timestamp: i64,
}
/// Code server listening on a port address.
#[derive(Clone)]
pub struct SocketCodeServer {
pub commit_id: String,
pub socket: PathBuf,
pub origin: Arc<CodeServerOrigin>,
}
/// Code server listening on a socket address.
#[derive(Clone)]
pub struct PortCodeServer {
pub commit_id: String,
pub port: u16,
pub origin: Arc<CodeServerOrigin>,
}
/// A server listening on any address/location.
pub enum AnyCodeServer {
Socket(SocketCodeServer),
Port(PortCodeServer),
}
// impl AnyCodeServer {
// pub fn origin(&mut self) -> &mut CodeServerOrigin {
// match self {
// AnyCodeServer::Socket(p) => &mut p.origin,
// AnyCodeServer::Port(p) => &mut p.origin,
// }
// }
// }
pub enum CodeServerOrigin {
/// A new code server, that opens the barrier when it exits.
New(Box<Child>),
/// An existing code server with a PID.
Existing(u32),
}
impl CodeServerOrigin {
pub async fn wait_for_exit(&mut self) {
match self {
CodeServerOrigin::New(child) => {
child.wait().await.ok();
}
CodeServerOrigin::Existing(pid) => {
let mut interval = interval(Duration::from_secs(30));
while process_exists(*pid) {
interval.tick().await;
}
}
}
}
pub async fn kill(&mut self) {
match self {
CodeServerOrigin::New(child) => {
child.kill().await.ok();
}
CodeServerOrigin::Existing(pid) => {
kill_tree(*pid).await.ok();
}
}
}
}
async fn check_and_create_dir(path: &Path) -> Result<(), WrappedError> {
tokio::fs::create_dir_all(path)
.await
.map_err(|e| wrap(e, "error creating server directory"))?;
Ok(())
}
async fn install_server_if_needed(
log: &log::Logger,
paths: &ServerPaths,
release: &Release,
http: impl SimpleHttp + Send + Sync + 'static,
) -> Result<(), AnyError> {
if paths.executable.exists() {
info!(
log,
"Found existing installation at {}",
paths.server_dir.display()
);
return Ok(());
}
let tar_file_path = spanf!(
log,
log.span("server.download"),
download_server(&paths.server_dir, release, log, http)
)?;
span!(
log,
log.span("server.extract"),
install_server(&tar_file_path, paths, log)
)?;
Ok(())
}
async fn download_server(
path: &Path,
release: &Release,
log: &log::Logger,
http: impl SimpleHttp + Send + Sync + 'static,
) -> Result<PathBuf, AnyError> {
let response = UpdateService::new(log.clone(), http)
.get_download_stream(release)
.await?;
let mut save_path = path.to_owned();
save_path.push("archive");
info!(
log,
"Downloading {} server -> {}",
QUALITYLESS_PRODUCT_NAME,
save_path.display()
);
http::download_into_file(
&save_path,
log.get_download_logger("server download progress:"),
response,
)
.await?;
Ok(save_path)
}
fn install_server(
compressed_file: &Path,
paths: &ServerPaths,
log: &log::Logger,
) -> Result<(), AnyError> {
info!(log, "Setting up server...");
unzip_downloaded_release(compressed_file, &paths.server_dir, SilentCopyProgress())?;
match fs::remove_file(compressed_file) {
Ok(()) => {}
Err(e) => {
if e.kind() != ErrorKind::NotFound {
return Err(AnyError::from(wrap(e, "error removing downloaded file")));
}
}
}
if !paths.executable.exists() {
return Err(AnyError::from(MissingEntrypointError()));
}
Ok(())
}
/// Ensures the given list of extensions are installed on the running server.
async fn do_extension_install_on_running_server(
start_script_path: &Path,
extensions: &[String],
log: &log::Logger,
) -> Result<(), AnyError> {
if extensions.is_empty() {
return Ok(());
}
debug!(log, "Installing extensions...");
let command = format!(
"{} {}",
start_script_path.display(),
extensions
.iter()
.map(|s| get_extensions_flag(s))
.collect::<Vec<String>>()
.join(" ")
);
let result = capture_command("bash", &["-c", &command]).await?;
if !result.status.success() {
Err(AnyError::from(ExtensionInstallFailed(
String::from_utf8_lossy(&result.stderr).to_string(),
)))
} else {
Ok(())
}
}
pub struct ServerBuilder<'a, Http: SimpleHttp + Send + Sync + Clone> {
logger: &'a log::Logger,
server_params: &'a ResolvedServerParams,
last_used: LastUsedServers<'a>,
server_paths: ServerPaths,
http: Http,
}
impl<'a, Http: SimpleHttp + Send + Sync + Clone + 'static> ServerBuilder<'a, Http> {
pub fn new(
logger: &'a log::Logger,
server_params: &'a ResolvedServerParams,
launcher_paths: &'a LauncherPaths,
http: Http,
) -> Self {
Self {
logger,
server_params,
last_used: LastUsedServers::new(launcher_paths),
server_paths: server_params
.as_installed_server()
.server_paths(launcher_paths),
http,
}
}
/// Gets any already-running server from this directory.
pub async fn get_running(&self) -> Result<Option<AnyCodeServer>, AnyError> {
info!(
self.logger,
"Checking {} and {} for a running server...",
self.server_paths.logfile.display(),
self.server_paths.pidfile.display()
);
let pid = match self.server_paths.get_running_pid() {
Some(pid) => pid,
None => return Ok(None),
};
info!(self.logger, "Found running server (pid={})", pid);
if !Path::new(&self.server_paths.logfile).exists() {
warning!(self.logger, "{} Server is running but its logfile is missing. Don't delete the {} Server manually, run the command '{} prune'.", QUALITYLESS_PRODUCT_NAME, QUALITYLESS_PRODUCT_NAME, APPLICATION_NAME);
return Ok(None);
}
do_extension_install_on_running_server(
&self.server_paths.executable,
&self.server_params.code_server_args.install_extensions,
self.logger,
)
.await?;
let origin = Arc::new(CodeServerOrigin::Existing(pid));
let contents = fs::read_to_string(&self.server_paths.logfile)
.expect("Something went wrong reading log file");
if let Some(port) = parse_port_from(&contents) {
Ok(Some(AnyCodeServer::Port(PortCodeServer {
commit_id: self.server_params.release.commit.to_owned(),
port,
origin,
})))
} else if let Some(socket) = parse_socket_from(&contents) {
Ok(Some(AnyCodeServer::Socket(SocketCodeServer {
commit_id: self.server_params.release.commit.to_owned(),
socket,
origin,
})))
} else {
Ok(None)
}
}
/// Ensures the server is set up in the configured directory.
pub async fn setup(&self) -> Result<(), AnyError> {
debug!(
self.logger,
"Installing and setting up {}...", QUALITYLESS_SERVER_NAME
);
check_and_create_dir(&self.server_paths.server_dir).await?;
install_server_if_needed(
self.logger,
&self.server_paths,
&self.server_params.release,
self.http.clone(),
)
.await?;
debug!(self.logger, "Server setup complete");
match self.last_used.add(self.server_params.as_installed_server()) {
Err(e) => warning!(self.logger, "Error adding server to last used: {}", e),
Ok(count) if count > MAX_RETAINED_SERVERS => {
if let Err(e) = self.last_used.trim(self.logger, MAX_RETAINED_SERVERS) {
warning!(self.logger, "Error trimming old servers: {}", e);
}
}
Ok(_) => {}
}
Ok(())
}
pub async fn listen_on_default_socket(&self) -> Result<SocketCodeServer, AnyError> {
let requested_file = if cfg!(target_os = "windows") {
PathBuf::from(format!(r"\\.\pipe\vscode-server-{}", Uuid::new_v4()))
} else {
std::env::temp_dir().join(format!("vscode-server-{}", Uuid::new_v4()))
};
self.listen_on_socket(&requested_file).await
}
pub async fn listen_on_socket(&self, socket: &Path) -> Result<SocketCodeServer, AnyError> {
Ok(spanf!(
self.logger,
self.logger.span("server.start").with_attributes(vec! {
KeyValue::new("commit_id", self.server_params.release.commit.to_string()),
KeyValue::new("quality", format!("{}", self.server_params.release.quality)),
}),
self._listen_on_socket(socket)
)?)
}
async fn _listen_on_socket(&self, socket: &Path) -> Result<SocketCodeServer, AnyError> {
remove_file(&socket).await.ok(); // ignore any error if it doesn't exist
let mut cmd = self.get_base_command();
cmd.arg("--start-server")
.arg("--enable-remote-auto-shutdown")
.arg(format!("--socket-path={}", socket.display()));
let child = self.spawn_server_process(cmd)?;
let log_file = self.get_logfile()?;
let plog = self.logger.prefixed(&log::new_code_server_prefix());
let (mut origin, listen_rx) =
monitor_server::<SocketMatcher, PathBuf>(child, Some(log_file), plog, false);
let socket = match timeout(Duration::from_secs(8), listen_rx).await {
Err(e) => {
origin.kill().await;
Err(wrap(e, "timed out looking for socket"))
}
Ok(Err(e)) => {
origin.kill().await;
Err(wrap(e, "server exited without writing socket"))
}
Ok(Ok(socket)) => Ok(socket),
}?;
info!(self.logger, "Server started");
Ok(SocketCodeServer {
commit_id: self.server_params.release.commit.to_owned(),
socket,
origin: Arc::new(origin),
})
}
/// Starts with a given opaque set of args. Does not set up any port or
/// socket, but does return one if present, in the form of a channel.
pub async fn start_opaque_with_args<M, R>(
&self,
args: &[String],
) -> Result<(CodeServerOrigin, Receiver<R>), AnyError>
where
M: ServerOutputMatcher<R>,
R: 'static + Send + std::fmt::Debug,
{
let mut cmd = self.get_base_command();
cmd.args(args);
let child = self.spawn_server_process(cmd)?;
let plog = self.logger.prefixed(&log::new_code_server_prefix());
Ok(monitor_server::<M, R>(child, None, plog, true))
}
fn spawn_server_process(&self, mut cmd: Command) -> Result<Child, AnyError> {
info!(self.logger, "Starting server...");
debug!(self.logger, "Starting server with command... {:?}", cmd);
let child = cmd
.stderr(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.spawn()
.map_err(|e| wrap(e, "error spawning server"))?;
self.server_paths
.write_pid(child.id().expect("expected server to have pid"))?;
Ok(child)
}
fn get_logfile(&self) -> Result<File, WrappedError> {
File::create(&self.server_paths.logfile).map_err(|e| {
wrap(
e,
format!(
"error creating log file {}",
self.server_paths.logfile.display()
),
)
})
}
fn get_base_command(&self) -> Command {
let mut cmd = Command::new(&self.server_paths.executable);
cmd.stdin(std::process::Stdio::null())
.args(self.server_params.code_server_args.command_arguments());
cmd
}
}
fn monitor_server<M, R>(
mut child: Child,
log_file: Option<File>,
plog: log::Logger,
write_directly: bool,
) -> (CodeServerOrigin, Receiver<R>)
where
M: ServerOutputMatcher<R>,
R: 'static + Send + std::fmt::Debug,
{
let stdout = child
.stdout
.take()
.expect("child did not have a handle to stdout");
let stderr = child
.stderr
.take()
.expect("child did not have a handle to stdout");
let (listen_tx, listen_rx) = tokio::sync::oneshot::channel();
// Handle stderr and stdout in a separate task. Initially scan lines looking
// for the listening port. Afterwards, just scan and write out to the file.
tokio::spawn(async move {
let mut stdout_reader = BufReader::new(stdout).lines();
let mut stderr_reader = BufReader::new(stderr).lines();
let write_line = |line: &str| -> std::io::Result<()> {
if let Some(mut f) = log_file.as_ref() {
f.write_all(line.as_bytes())?;
f.write_all(&[b'\n'])?;
}
if write_directly {
println!("{}", line);
} else {
trace!(plog, line);
}
Ok(())
};
loop {
let line = tokio::select! {
l = stderr_reader.next_line() => l,
l = stdout_reader.next_line() => l,
};
match line {
Err(e) => {
trace!(plog, "error reading from stdout/stderr: {}", e);
return;
}
Ok(None) => break,
Ok(Some(l)) => {
write_line(&l).ok();
if let Some(listen_on) = M::match_line(&l) {
trace!(plog, "parsed location: {:?}", listen_on);
listen_tx.send(listen_on).ok();
break;
}
}
}
}
loop {
let line = tokio::select! {
l = stderr_reader.next_line() => l,
l = stdout_reader.next_line() => l,
};
match line {
Err(e) => {
trace!(plog, "error reading from stdout/stderr: {}", e);
break;
}
Ok(None) => break,
Ok(Some(l)) => {
write_line(&l).ok();
}
}
}
});
let origin = CodeServerOrigin::New(Box::new(child));
(origin, listen_rx)
}
fn get_extensions_flag(extension_id: &str) -> String {
format!("--install-extension={}", extension_id)
}
/// A type that can be used to scan stdout from the VS Code server. Returns
/// some other type that, in turn, is returned from starting the server.
pub trait ServerOutputMatcher<R>
where
R: Send,
{
fn match_line(line: &str) -> Option<R>;
}
/// Parses a line like "Extension host agent listening on /tmp/foo.sock"
struct SocketMatcher();
impl ServerOutputMatcher<PathBuf> for SocketMatcher {
fn match_line(line: &str) -> Option<PathBuf> {
parse_socket_from(line)
}
}
/// Parses a line like "Extension host agent listening on 9000"
pub struct PortMatcher();
impl ServerOutputMatcher<u16> for PortMatcher {
fn match_line(line: &str) -> Option<u16> {
parse_port_from(line)
}
}
/// Parses a line like "Web UI available at http://localhost:9000/?tkn=..."
pub struct WebUiMatcher();
impl ServerOutputMatcher<reqwest::Url> for WebUiMatcher {
fn match_line(line: &str) -> Option<reqwest::Url> {
WEB_UI_RE.captures(line).and_then(|cap| {
cap.get(1)
.and_then(|uri| reqwest::Url::parse(uri.as_str()).ok())
})
}
}
/// Does not do any parsing and just immediately returns an empty result.
pub struct NoOpMatcher();
impl ServerOutputMatcher<()> for NoOpMatcher {
fn match_line(_: &str) -> Option<()> {
Some(())
}
}
fn parse_socket_from(text: &str) -> Option<PathBuf> {
LISTENING_PORT_RE
.captures(text)
.and_then(|cap| cap.get(1).map(|path| PathBuf::from(path.as_str())))
}
fn parse_port_from(text: &str) -> Option<u16> {
LISTENING_PORT_RE.captures(text).and_then(|cap| {
cap.get(1)
.and_then(|path| path.as_str().parse::<u16>().ok())
})
}