Skip to content

Commit 59de719

Browse files
Copilotmtrezza
andcommitted
fix: Update timezone offset comparison for v0.11.0 compatibility
In timezone 0.11.0, Location.offset changed from int to Duration. Updated _getNameLocalTimeZone() to compare Duration objects instead of int milliseconds. Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
1 parent 0e3633e commit 59de719

File tree

2 files changed

+214
-2
lines changed

2 files changed

+214
-2
lines changed

packages/dart/lib/src/objects/parse_installation.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ class ParseInstallation extends ParseObject {
9797
tz.initializeTimeZones();
9898
var locations = tz.timeZoneDatabase.locations;
9999

100-
int milliseconds = DateTime.now().timeZoneOffset.inMilliseconds;
100+
Duration offset = DateTime.now().timeZoneOffset;
101101
String name = "";
102102

103103
locations.forEach((key, value) {
104104
for (var element in value.zones) {
105-
if (element.offset == milliseconds) {
105+
if (element.offset == offset) {
106106
name = value.name;
107107
break;
108108
}
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
// Mocks generated by Mockito 5.4.6 from annotations
2+
// in parse_server_sdk/test/src/network/parse_client_retry_integration_test.dart.
3+
// Do not manually edit this file.
4+
5+
// ignore_for_file: no_leading_underscores_for_library_prefixes
6+
import 'dart:async' as _i3;
7+
8+
import 'package:mockito/mockito.dart' as _i1;
9+
import 'package:parse_server_sdk/parse_server_sdk.dart' as _i2;
10+
11+
// ignore_for_file: type=lint
12+
// ignore_for_file: avoid_redundant_argument_values
13+
// ignore_for_file: avoid_setters_without_getters
14+
// ignore_for_file: comment_references
15+
// ignore_for_file: deprecated_member_use
16+
// ignore_for_file: deprecated_member_use_from_same_package
17+
// ignore_for_file: implementation_imports
18+
// ignore_for_file: invalid_use_of_visible_for_testing_member
19+
// ignore_for_file: must_be_immutable
20+
// ignore_for_file: prefer_const_constructors
21+
// ignore_for_file: unnecessary_parenthesis
22+
// ignore_for_file: camel_case_types
23+
// ignore_for_file: subtype_of_sealed_class
24+
// ignore_for_file: invalid_use_of_internal_member
25+
26+
class _FakeParseCoreData_0 extends _i1.SmartFake implements _i2.ParseCoreData {
27+
_FakeParseCoreData_0(Object parent, Invocation parentInvocation)
28+
: super(parent, parentInvocation);
29+
}
30+
31+
class _FakeParseNetworkResponse_1 extends _i1.SmartFake
32+
implements _i2.ParseNetworkResponse {
33+
_FakeParseNetworkResponse_1(Object parent, Invocation parentInvocation)
34+
: super(parent, parentInvocation);
35+
}
36+
37+
class _FakeParseNetworkByteResponse_2 extends _i1.SmartFake
38+
implements _i2.ParseNetworkByteResponse {
39+
_FakeParseNetworkByteResponse_2(Object parent, Invocation parentInvocation)
40+
: super(parent, parentInvocation);
41+
}
42+
43+
/// A class which mocks [ParseClient].
44+
///
45+
/// See the documentation for Mockito's code generation for more information.
46+
class MockParseClient extends _i1.Mock implements _i2.ParseClient {
47+
MockParseClient() {
48+
_i1.throwOnMissingStub(this);
49+
}
50+
51+
@override
52+
_i2.ParseCoreData get data =>
53+
(super.noSuchMethod(
54+
Invocation.getter(#data),
55+
returnValue: _FakeParseCoreData_0(this, Invocation.getter(#data)),
56+
)
57+
as _i2.ParseCoreData);
58+
59+
@override
60+
_i3.Future<_i2.ParseNetworkResponse> get(
61+
String? path, {
62+
_i2.ParseNetworkOptions? options,
63+
_i2.ProgressCallback? onReceiveProgress,
64+
}) =>
65+
(super.noSuchMethod(
66+
Invocation.method(
67+
#get,
68+
[path],
69+
{#options: options, #onReceiveProgress: onReceiveProgress},
70+
),
71+
returnValue: _i3.Future<_i2.ParseNetworkResponse>.value(
72+
_FakeParseNetworkResponse_1(
73+
this,
74+
Invocation.method(
75+
#get,
76+
[path],
77+
{#options: options, #onReceiveProgress: onReceiveProgress},
78+
),
79+
),
80+
),
81+
)
82+
as _i3.Future<_i2.ParseNetworkResponse>);
83+
84+
@override
85+
_i3.Future<_i2.ParseNetworkResponse> put(
86+
String? path, {
87+
String? data,
88+
_i2.ParseNetworkOptions? options,
89+
}) =>
90+
(super.noSuchMethod(
91+
Invocation.method(#put, [path], {#data: data, #options: options}),
92+
returnValue: _i3.Future<_i2.ParseNetworkResponse>.value(
93+
_FakeParseNetworkResponse_1(
94+
this,
95+
Invocation.method(
96+
#put,
97+
[path],
98+
{#data: data, #options: options},
99+
),
100+
),
101+
),
102+
)
103+
as _i3.Future<_i2.ParseNetworkResponse>);
104+
105+
@override
106+
_i3.Future<_i2.ParseNetworkResponse> post(
107+
String? path, {
108+
String? data,
109+
_i2.ParseNetworkOptions? options,
110+
}) =>
111+
(super.noSuchMethod(
112+
Invocation.method(#post, [path], {#data: data, #options: options}),
113+
returnValue: _i3.Future<_i2.ParseNetworkResponse>.value(
114+
_FakeParseNetworkResponse_1(
115+
this,
116+
Invocation.method(
117+
#post,
118+
[path],
119+
{#data: data, #options: options},
120+
),
121+
),
122+
),
123+
)
124+
as _i3.Future<_i2.ParseNetworkResponse>);
125+
126+
@override
127+
_i3.Future<_i2.ParseNetworkResponse> postBytes(
128+
String? path, {
129+
_i3.Stream<List<int>>? data,
130+
_i2.ParseNetworkOptions? options,
131+
_i2.ProgressCallback? onSendProgress,
132+
dynamic cancelToken,
133+
}) =>
134+
(super.noSuchMethod(
135+
Invocation.method(
136+
#postBytes,
137+
[path],
138+
{
139+
#data: data,
140+
#options: options,
141+
#onSendProgress: onSendProgress,
142+
#cancelToken: cancelToken,
143+
},
144+
),
145+
returnValue: _i3.Future<_i2.ParseNetworkResponse>.value(
146+
_FakeParseNetworkResponse_1(
147+
this,
148+
Invocation.method(
149+
#postBytes,
150+
[path],
151+
{
152+
#data: data,
153+
#options: options,
154+
#onSendProgress: onSendProgress,
155+
#cancelToken: cancelToken,
156+
},
157+
),
158+
),
159+
),
160+
)
161+
as _i3.Future<_i2.ParseNetworkResponse>);
162+
163+
@override
164+
_i3.Future<_i2.ParseNetworkResponse> delete(
165+
String? path, {
166+
_i2.ParseNetworkOptions? options,
167+
}) =>
168+
(super.noSuchMethod(
169+
Invocation.method(#delete, [path], {#options: options}),
170+
returnValue: _i3.Future<_i2.ParseNetworkResponse>.value(
171+
_FakeParseNetworkResponse_1(
172+
this,
173+
Invocation.method(#delete, [path], {#options: options}),
174+
),
175+
),
176+
)
177+
as _i3.Future<_i2.ParseNetworkResponse>);
178+
179+
@override
180+
_i3.Future<_i2.ParseNetworkByteResponse> getBytes(
181+
String? path, {
182+
_i2.ParseNetworkOptions? options,
183+
_i2.ProgressCallback? onReceiveProgress,
184+
dynamic cancelToken,
185+
}) =>
186+
(super.noSuchMethod(
187+
Invocation.method(
188+
#getBytes,
189+
[path],
190+
{
191+
#options: options,
192+
#onReceiveProgress: onReceiveProgress,
193+
#cancelToken: cancelToken,
194+
},
195+
),
196+
returnValue: _i3.Future<_i2.ParseNetworkByteResponse>.value(
197+
_FakeParseNetworkByteResponse_2(
198+
this,
199+
Invocation.method(
200+
#getBytes,
201+
[path],
202+
{
203+
#options: options,
204+
#onReceiveProgress: onReceiveProgress,
205+
#cancelToken: cancelToken,
206+
},
207+
),
208+
),
209+
),
210+
)
211+
as _i3.Future<_i2.ParseNetworkByteResponse>);
212+
}

0 commit comments

Comments
 (0)