From fbaaeaf98cdb32f7bb72da3fda23835094894393 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 21 Nov 2024 13:12:08 +0900 Subject: [PATCH] [ios] sync date from http response when fetch experiments --- ios/Nativebrik/Nativebrik/data/experiment.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/Nativebrik/Nativebrik/data/experiment.swift b/ios/Nativebrik/Nativebrik/data/experiment.swift index ec38b30..8386615 100644 --- a/ios/Nativebrik/Nativebrik/data/experiment.swift +++ b/ios/Nativebrik/Nativebrik/data/experiment.swift @@ -25,10 +25,12 @@ class ExperimentRepositoryImpl: ExperimentRepository2 { var request = URLRequest(url: url) request.httpMethod = "GET" do { + let t0 = getCurrentDate() let (data, response) = try await nativebrikSession.data(for: request) guard let res = response as? HTTPURLResponse else { return Result.failure(NativebrikError.irregular("Failed to parse as HttpURLResponse")) } + syncDateFromHTTPURLResponse(t0: t0, res: res) if res.statusCode == 404 { return Result.failure(NativebrikError.notFound) } @@ -49,10 +51,12 @@ class ExperimentRepositoryImpl: ExperimentRepository2 { var request = URLRequest(url: url) request.httpMethod = "GET" do { + let t0 = getCurrentDate() let (data, response) = try await nativebrikSession.data(for: request) guard let res = response as? HTTPURLResponse else { return Result.failure(NativebrikError.irregular("Failed to parse as HttpURLResponse")) } + syncDateFromHTTPURLResponse(t0: t0, res: res) if res.statusCode == 404 { return Result.failure(NativebrikError.notFound) }