@@ -122,24 +122,6 @@ public void deviceIdChanged(String oldDeviceId, boolean withMerge) {
122122 }
123123 }
124124
125- /**
126- * Puts {@code "device_id"} parameter into all requests which don't have it yet
127- *
128- * @param config InternalConfig to run in
129- * @param deviceId deviceId string
130- * @return {@code true} if {@link Request}s changed successfully, {@code false} otherwise
131- */
132- private boolean transformRequests (final InternalConfig config , final String deviceId ) {
133- return Storage .transform (config , Request .getStoragePrefix (), (id , data ) -> {
134- Request request = new Request (id );
135- if (request .restore (data , L ) && !request .params .has (Params .PARAM_DEVICE_ID )) {
136- request .params .add (Params .PARAM_DEVICE_ID , deviceId );
137- return request .store (L );
138- }
139- return null ;
140- });
141- }
142-
143125 /**
144126 * Logging into app-specific account:
145127 * - reset device id and notify modules;
@@ -192,7 +174,6 @@ protected void changeDeviceIdInternal(String id, DeviceIdType type, boolean with
192174 L .d ("[ModuleDeviceIdCore] changeDeviceIdInternal, Ending session because device id was unset from [" + old .id + "]" );
193175 session .end (null , null , old .id );
194176 }
195- changeOldRequestsDeviceIds (did );
196177 }
197178
198179 SDKCore .instance .notifyModulesDeviceIdChanged (old .id , withMerge );
@@ -239,34 +220,6 @@ protected Config.DID acquireId(final InternalConfig config) {
239220 return did ;
240221 }
241222
242- private void changeOldRequestsDeviceIds (Config .DID deviceId ) {
243- if (this .tasks == null ) {
244- this .tasks = new Tasks ("deviceId" , L );
245- }
246- tasks .run (new Tasks .Task <Object >(0L ) {
247- @ Override
248- public Object call () {
249- // put device_id parameter into existing requests
250- L .i ("[ModuleDeviceIdCore] changeOldRequestsDeviceIds, Adding device_id to previous requests" );
251- boolean success = transformRequests (internalConfig , deviceId .id );
252- if (success ) {
253- L .i ("[ModuleDeviceIdCore] changeOldRequestsDeviceIds, First transform: success" );
254- } else {
255- L .w ("[ModuleDeviceIdCore] changeOldRequestsDeviceIds, First transform: failure" );
256- }
257-
258- // do it second time in case new requests were added during first attempt
259- success = transformRequests (internalConfig , deviceId .id );
260- if (!success ) {
261- L .e ("[ModuleDeviceIdCore] changeOldRequestsDeviceIds, Failed to put device_id into existing requests, following behaviour for unhandled requests is undefined." );
262- } else {
263- L .i ("[ModuleDeviceIdCore] changeOldRequestsDeviceIds, Second transform: success" );
264- }
265- return null ;
266- }
267- });
268- }
269-
270223 @ Override
271224 public void stop (InternalConfig config , boolean clear ) {
272225 if (tasks != null ) {
0 commit comments