Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSSDK-10941] event processor files and directories cleanup - part 1 #966

Merged
merged 4 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/event_processor/batch_event_processor.react_native.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { vi, describe, it, expect, beforeEach } from 'vitest';

const mockNetInfo = vi.hoisted(() => {
const netInfo = {
listeners: [],
unsubs: [],
listeners: [] as any[],
unsubs: [] as any[],
addEventListener(fn: any) {
this.listeners.push(fn);
const unsub = vi.fn();
Expand All @@ -46,15 +46,13 @@ vi.mock('../utils/import.react_native/@react-native-community/netinfo', () => {
});

import { ReactNativeNetInfoEventProcessor } from './batch_event_processor.react_native';
import { getMockLogger } from '../tests/mock/mock_logger';
import { getMockRepeater } from '../tests/mock/mock_repeater';
import { getMockAsyncCache } from '../tests/mock/mock_cache';

import { EventWithId } from './batch_event_processor';
import { EventDispatcher } from './eventDispatcher';
import { formatEvents } from './v1/buildEventV1';
import { formatEvents } from './event_builder/build_event_v1';
import { createImpressionEvent } from '../tests/mock/create_event';
import { ProcessableEvent } from './eventProcessor';
import { ProcessableEvent } from './event_processor';

const getMockDispatcher = () => {
return {
Expand Down
7 changes: 3 additions & 4 deletions lib/event_processor/batch_event_processor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ import { expect, describe, it, vi, beforeEach, afterEach, MockInstance } from 'v
import { EventWithId, BatchEventProcessor } from './batch_event_processor';
import { getMockSyncCache } from '../tests/mock/mock_cache';
import { createImpressionEvent } from '../tests/mock/create_event';
import { ProcessableEvent } from './eventProcessor';
import { EventDispatcher } from './eventDispatcher';
import { formatEvents } from './v1/buildEventV1';
import { ResolvablePromise, resolvablePromise } from '../utils/promise/resolvablePromise';
import { ProcessableEvent } from './event_processor';
import { formatEvents } from './event_builder/build_event_v1';
import { resolvablePromise } from '../utils/promise/resolvablePromise';
import { advanceTimersByTime } from '../../tests/testUtils';
import { getMockLogger } from '../tests/mock/mock_logger';
import { getMockRepeater } from '../tests/mock/mock_repeater';
Expand Down
6 changes: 3 additions & 3 deletions lib/event_processor/batch_event_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import { EventProcessor, ProcessableEvent } from "./eventProcessor";
import { EventProcessor, ProcessableEvent } from "./event_processor";
import { Cache } from "../utils/cache/cache";
import { EventDispatcher, EventDispatcherResponse, EventV1Request } from "./eventDispatcher";
import { formatEvents } from "../core/event_builder/build_event_v1";
import { EventDispatcher, EventDispatcherResponse, EventV1Request } from "./event_dispatcher";
import { formatEvents } from "./event_builder/build_event_v1";
import { BackoffController, ExponentialBackoff, IntervalRepeater, Repeater } from "../utils/repeater/repeater";
import { LoggerFacade } from "../modules/logging";
import { BaseService, ServiceState, StartupLog } from "../service";
Expand Down
2 changes: 1 addition & 1 deletion lib/event_processor/default_dispatcher.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { BrowserRequestHandler } from "../utils/http_request_handler/browser_request_handler";
import { EventDispatcher } from '../event_processor/eventDispatcher';
import { EventDispatcher } from './event_dispatcher';
import { DefaultEventDispatcher } from './default_dispatcher';

const eventDispatcher: EventDispatcher = new DefaultEventDispatcher(new BrowserRequestHandler());
Expand Down
2 changes: 1 addition & 1 deletion lib/event_processor/default_dispatcher.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { EventDispatcher } from '../event_processor/eventDispatcher';
import { EventDispatcher } from './event_dispatcher';
import { NodeRequestHandler } from '../utils/http_request_handler/node_request_handler';
import { DefaultEventDispatcher } from './default_dispatcher';

Expand Down
2 changes: 1 addition & 1 deletion lib/event_processor/default_dispatcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import { expect, vi, describe, it } from 'vitest';
import { DefaultEventDispatcher } from './default_dispatcher';
import { EventV1 } from '../event_processor';
import { EventV1 } from './event_builder/build_event_v1';

const getEvent = (): EventV1 => {
return {
Expand Down
2 changes: 1 addition & 1 deletion lib/event_processor/default_dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { RequestHandler } from '../utils/http_request_handler/http';
import { EventDispatcher, EventDispatcherResponse, EventV1Request } from '../event_processor/eventDispatcher';
import { EventDispatcher, EventDispatcherResponse, EventV1Request } from './event_dispatcher';

export class DefaultEventDispatcher implements EventDispatcher {
private requestHandler: RequestHandler;
Expand Down
Loading
Loading