nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: decaffeinate/decaffeinate
Pull request #2482 (2022-07-11 00:00:19)

fix: allow `--modernize-js` with `--no-bare`
I don't see why this would be useful, but might as well allow it. Per https://github.com/decaffeinate/decaffeinate/pull/2481#discussion_r917463444.


Patch:
diff --git a/src/cli.ts b/src/cli.ts
index 8ac22786..d1e6d181 100644
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -193,10 +193,6 @@ function parseArguments(args: ReadonlyArray<string>, io: IO): ParseOptionsResult
     }
   }
 
-  if (!baseOptions.bare && modernizeJS) {
-    return { kind: 'error', message: 'cannot use --modernize-js with --no-bare' };
-  }
-
   if (!baseOptions.bare && baseOptions.useJSModules) {
     return { kind: 'error', message: 'cannot use --use-js-modules with --no-bare' };
   }
diff --git a/src/index.ts b/src/index.ts
index 02118d0f..f69b63cd 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -94,7 +94,7 @@ export function modernizeJS(source: string, options: Options = {}): ConversionRe
   const result = runStages(source, options, stages);
   result.code = convertNewlines(result.code, originalNewlineStr);
   return {
-    code: result.code,
+    code: options.bare ? result.code : `(function() {\n${result.code}\n}).call(this);`,
   };
 }
 


Test patch:
diff --git a/test/cli_test.ts b/test/cli_test.ts
index 4e3ee0ae..66eaafa4 100644
--- a/test/cli_test.ts
+++ b/test/cli_test.ts
@@ -528,6 +528,10 @@ describe('decaffeinate CLI', () => {
     await runCli(['--modernize-js'], 'var a;', 'let a;');
   });
 
+  it('allows --modernize-js with --no-bare', async () => {
+    await runCli(['--modernize-js', '--no-bare'], 'var a;', '(function() {\nlet a;\n}).call(this);');
+  });
+
   it('discovers JS files with --modernize-js specified', async () => {
     copySync('./test_fixtures/F.js', './test_fixtures/searchDir/F.js');
     await runCli(
@@ -567,18 +571,6 @@ describe('decaffeinate CLI', () => {
     await runCli(['--no-bare'], '', `(function() {\n\n}).call(this);`);
   });
 
-  it('cannot use --modernize-js with --no-bare', async () => {
-    await runCli(
-      ['--no-bare', '--modernize-js'],
-      '',
-      '',
-      `
-      cannot use --modernize-js with --no-bare
-    `,
-      1
-    );
-  });
-
   it('cannot use --use-js-modules with --no-bare', async () => {
     await runCli(
       ['--no-bare', '--use-js-modules'],
Repository: decaffeinate/decaffeinate
Pull request #2512 (2022-09-10 05:34:24)

Exit with code 1 when the patcher fails
Tools like `bulk-decaffeinate` rely on errors to determine when it is safe to run `decaffeinate`.

Currently, running `decaffeinate --disallow-invalid-constructors` exits with code 0 instead of code 1, which leads `bulk-decaffeinate` to believe no errors were encountered in the "check" run.

This change makes it instead exit with code 1, which results in the correct behavior in `bulk-decaffeinate`.


Patch:
diff --git a/src/cli.ts b/src/cli.ts
index d1e6d181..cf4010dd 100644
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -37,13 +37,11 @@ export default async function run(
     return 0;
   }
 
-  if (options.paths.length) {
-    await runWithPaths(options.paths, options, io);
-  } else {
-    await runWithStdio(options, io);
-  }
+  const success = options.paths.length
+    ? await runWithPaths(options.paths, options, io)
+    : await runWithStdio(options, io);
 
-  return 0;
+  return success ? 0 : 1;
 }
 
 type ParseOptionsResult = CLIOptions | ParseOptionsError;
@@ -203,7 +201,7 @@ function parseArguments(args: ReadonlyArray<string>, io: IO): ParseOptionsResult
 /**
  * Run decaffeinate on the given paths, changing them in place.
  */
-async function runWithPaths(paths: Array<string>, options: CLIOptions, io: IO): Promise<void> {
+async function runWithPaths(paths: Array<string>, options: CLIOptions, io: IO): Promise<boolean> {
   async function processPath(path: string): Promise<boolean> {
     const info = await stat(path);
     if (info.isDirectory()) {
@@ -254,8 +252,12 @@ async function runWithPaths(paths: Array<string>, options: CLIOptions, io: IO):
   }
 
   for (const path of paths) {
-    await processPath(path);
+    if (!(await processPath(path))) {
+      return false;
+    }
   }
+
+  return true;
 }
 
 async function runWithStdio(options: CLIOptions, io: IO): Promise<boolean> {


Test patch:
diff --git a/test/cli_test.ts b/test/cli_test.ts
index 66eaafa4..04615373 100644
--- a/test/cli_test.ts
+++ b/test/cli_test.ts
@@ -435,7 +435,8 @@ describe('decaffeinate CLI', () => {
       > 2 |   constructor: ->
       > 3 |     @a = 1
       > 4 |     super(arguments...)
-    `
+    `,
+      1
     );
   });
Repository: dcastil/tailwind-merge
Pull request #546 (2025-03-09 15:19:05)

Add support for Tailwind CSS v4.0.10
There was a new feature introduced in [Tailwind CSS v4.0.10](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.10):

> Add `col-<number>` and `row-<number>` utilities for grid-column and grid-row (https://github.com/tailwindlabs/tailwindcss/pull/15183)

Adding support for it here.


Patch:
diff --git a/src/lib/default-config.ts b/src/lib/default-config.ts
index bc0193e..c8d375f 100644
--- a/src/lib/default-config.ts
+++ b/src/lib/default-config.ts
@@ -83,6 +83,7 @@ export const getDefaultConfig = () => {
         [
             'auto',
             { span: ['full', isInteger, isArbitraryVariable, isArbitraryValue] },
+            isInteger,
             isArbitraryVariable,
             isArbitraryValue,
         ] as const


Test patch:
diff --git a/tests/tailwind-css-versions.test.ts b/tests/tailwind-css-versions.test.ts
index 0b10d3b..c8588ec 100644
--- a/tests/tailwind-css-versions.test.ts
+++ b/tests/tailwind-css-versions.test.ts
@@ -79,4 +79,5 @@ test('supports Tailwind CSS v4.0 features', () => {
     expect(twMerge('font-stretch-expanded font-stretch-[66.66%] font-stretch-50%')).toBe(
         'font-stretch-50%',
     )
+    expect(twMerge('col-span-full col-2 row-span-3 row-4')).toBe('col-2 row-4')
 })
Repository: dcastil/tailwind-merge
Pull request #575 (2025-05-11 20:43:23)

Add support for tailwind CSS v4.1.5
Adding height-related `*-lh` utilities from https://github.com/tailwindlabs/tailwindcss/pull/17790.


Patch:
diff --git a/src/lib/default-config.ts b/src/lib/default-config.ts
index fbafd88..248331d 100644
--- a/src/lib/default-config.ts
+++ b/src/lib/default-config.ts
@@ -782,17 +782,17 @@ export const getDefaultConfig = () => {
              * Height
              * @see https://tailwindcss.com/docs/height
              */
-            h: [{ h: ['screen', ...scaleSizing()] }],
+            h: [{ h: ['screen', 'lh', ...scaleSizing()] }],
             /**
              * Min-Height
              * @see https://tailwindcss.com/docs/min-height
              */
-            'min-h': [{ 'min-h': ['screen', 'none', ...scaleSizing()] }],
+            'min-h': [{ 'min-h': ['screen', 'lh', 'none', ...scaleSizing()] }],
             /**
              * Max-Height
              * @see https://tailwindcss.com/docs/max-height
              */
-            'max-h': [{ 'max-h': ['screen', ...scaleSizing()] }],
+            'max-h': [{ 'max-h': ['screen', 'lh', ...scaleSizing()] }],
 
             // ------------------
             // --- Typography ---


Test patch:
diff --git a/tests/tailwind-css-versions.test.ts b/tests/tailwind-css-versions.test.ts
index 41fbcec..68d0dc9 100644
--- a/tests/tailwind-css-versions.test.ts
+++ b/tests/tailwind-css-versions.test.ts
@@ -161,3 +161,9 @@ test('supports Tailwind CSS v4.1 features', () => {
     expect(twMerge('drop-shadow-[#123456] drop-shadow-some-color')).toBe('drop-shadow-some-color')
     expect(twMerge('drop-shadow-2xl drop-shadow-[shadow:foo]')).toBe('drop-shadow-[shadow:foo]')
 })
+
+test('supports Tailwind CSS v4.1.5 features', () => {
+    expect(twMerge('h-12 h-lh')).toBe('h-lh')
+    expect(twMerge('min-h-12 min-h-lh')).toBe('min-h-lh')
+    expect(twMerge('max-h-12 max-h-lh')).toBe('max-h-lh')
+})
Repository: effector/effector
Pull request #406 (2020-10-19 22:08:23)

Fix guard return type (support union type)


Patch:
diff --git a/packages/effector/index.d.ts b/packages/effector/index.d.ts
index c17927c0..8e61a2af 100644
--- a/packages/effector/index.d.ts
+++ b/packages/effector/index.d.ts
@@ -133,7 +133,7 @@ export interface Event<Payload> extends Unit<Payload> {
  * `Event<T>`. This happens because `Event` has a callable signature. With `Unit<T>`
  * as the return type we won't see any problems.
  */
-type EventAsReturnType<Payload> = Payload extends any ? Event<Payload> : never
+type EventAsReturnType<Payload> = any extends Payload ? Event<Payload> : never
 
 export interface Effect<Params, Done, Fail = Error> extends Unit<Params> {
   (payload: Params): Promise<Done>


Test patch:
diff --git a/src/types/__tests__/effector/guard.test.js b/src/types/__tests__/effector/guard.test.js
index 1eccf177..92f7a117 100644
--- a/src/types/__tests__/effector/guard.test.js
+++ b/src/types/__tests__/effector/guard.test.js
@@ -888,3 +888,20 @@ describe('guard(config)', () => {
     })
   })
 })
+
+test('guard return type supports union types', () => {
+  const trigger: Event<{a: 1} | {a: 2}> = createEvent()
+  const allow = createStore<boolean>(false)
+
+  const result: Event<{a: 1} | {a: 2}> = guard(trigger, {filter: allow})
+
+  expect(typecheck).toMatchInlineSnapshot(`
+    "
+    --typescript--
+    no errors
+
+    --flow--
+    no errors
+    "
+  `)
+})
Repository: effector/effector
Pull request #426 (2020-11-22 09:36:34)

allow to use `remap` without `as const`
```tsx
const $data = createStore({
  foo: 1,
  bar: "two",
  baz: true,
})

const d: [
  Store<number>,
  Store<boolean>,
  Store<string>,
] = remap($data, ['foo', 'baz', 'bar'])
```


Patch:
diff --git a/packages/forest/index.d.ts b/packages/forest/index.d.ts
index 92294760..d676d50b 100644
--- a/packages/forest/index.d.ts
+++ b/packages/forest/index.d.ts
@@ -55,7 +55,10 @@ export function using(
 export function spec(spec: {
   attr?: PropertyMap
   data?: PropertyMap
-  text?: DOMProperty | AttributeStoreInput | Array<DOMProperty | AttributeStoreInput>
+  text?:
+    | DOMProperty
+    | AttributeStoreInput
+    | Array<DOMProperty | AttributeStoreInput>
   visible?: Store<boolean>
   style?: StylePropertyMap
   styleVar?: PropertyMap
@@ -83,7 +86,10 @@ export function h(
   spec: {
     attr?: PropertyMap
     data?: PropertyMap
-    text?: DOMProperty | AttributeStoreInput | Array<DOMProperty | AttributeStoreInput>
+    text?:
+      | DOMProperty
+      | AttributeStoreInput
+      | Array<DOMProperty | AttributeStoreInput>
     visible?: Store<boolean>
     style?: StylePropertyMap
     styleVar?: PropertyMap
@@ -199,17 +205,29 @@ export function text(
   ...values: Array<DOMProperty | AttributeStoreInput>
 ): void
 
-export function remap<T extends {[field: string]: any}, S extends keyof T>(
+export function remap<T extends Record<string, any>, Key extends keyof T>(
   store: Store<T>,
-  key: S,
-): Store<T[S]>
+  key: Key,
+): Store<T[Key]>
+export function remap<T extends Record<string, any>, Names extends string[]>(
+  store: Store<T>,
+  names: [...Names],
+): {
+  [Key in keyof Names]: Names[Key] extends keyof T
+    ? Store<T[Names[Key]]>
+    : never
+}
 export function remap<
-  T extends {[field: string]: any},
-  S extends {[field: number]: keyof T} | {[field: string]: keyof T}
+  T extends Record<string, any>,
+  Shape extends {[field: number]: keyof T} | {[field: string]: keyof T}
 >(
   store: Store<T>,
-  shape: S,
-): {[K in keyof S]: S[K] extends keyof T ? Store<T[S[K]]> : never}
+  shape: Shape,
+): {
+  [Key in keyof Shape]: Shape[Key] extends keyof T
+    ? Store<T[Shape[Key]]>
+    : never
+}
 
 export function val(
   words: TemplateStringsArray,


Test patch:
diff --git a/src/types/__tests__/forest/index.test.ts b/src/types/__tests__/forest/index.test.ts
index 708396b4..f9cfc7e0 100644
--- a/src/types/__tests__/forest/index.test.ts
+++ b/src/types/__tests__/forest/index.test.ts
@@ -122,8 +122,7 @@ describe('remap', () => {
       expect(typecheck).toMatchInlineSnapshot(`
         "
         --typescript--
-        Type 'Store<string | number>[]' is not assignable to type '[Store<string>, Store<number>]'.
-          Target requires 2 element(s) but source may have fewer.
+        no errors
         "
       `)
     })
Repository: effector/effector
Pull request #431 (2020-12-09 21:33:05)

Fix/useStore
Two different workarounds in two commits


Patch:
diff --git a/src/react/useStore.ts b/src/react/useStore.ts
index 671ffd9e..b37de385 100644
--- a/src/react/useStore.ts
+++ b/src/react/useStore.ts
@@ -6,7 +6,7 @@ import {throwError} from './throw'
 export function useStore<State>(store: Store<State>): State {
   if (!is.store(store)) throwError('expect useStore argument to be a store')
   const currentStore = React.useRef(store)
-  const setState = React.useState(store.getState())[1]
+  const setState = React.useReducer((_, action) => action, store.getState())[1];
   useIsomorphicLayoutEffect(() => {
     if (currentStore.current === store) {
       setState(store.getState())


Test patch:
diff --git a/src/react/__tests__/useStore.test.tsx b/src/react/__tests__/useStore.test.tsx
index 44c35b1b..4c5668a3 100644
--- a/src/react/__tests__/useStore.test.tsx
+++ b/src/react/__tests__/useStore.test.tsx
@@ -90,6 +90,32 @@ describe('useStore', () => {
       ]
     `)
   })
+  it('should correct work, when store contains function', async () => {
+    const fn = jest.fn()
+    const changeStore = createEvent()
+    const $store = createStore(() => 'initial').on(
+      changeStore,
+      (_, data) => p => data[p] || 'initial',
+    )
+
+    const Display = () => {
+      const store = useStore($store)
+      fn()
+      return store('key')
+    }
+
+    await render(<Display />)
+
+    expect(container.firstChild).toMatchInlineSnapshot(`initial`)
+    expect(fn).toHaveBeenCalledTimes(1)
+
+    await act(async () => {
+      changeStore({key: 'value'})
+    })
+
+    expect(container.firstChild).toMatchInlineSnapshot(`value`)
+    expect(fn).toHaveBeenCalledTimes(2)
+  })
   it('should subscribe before any react hook will change store', async () => {
     const fn = jest.fn()
     const fx = createEffect({
Repository: effector/effector
Pull request #470 (2021-03-19 19:14:29)

fix optional return false-positive check


Patch:
diff --git a/packages/effector/index.d.ts b/packages/effector/index.d.ts
index dfdc23ed..51b4d71e 100644
--- a/packages/effector/index.d.ts
+++ b/packages/effector/index.d.ts
@@ -542,16 +542,16 @@ export function split<
 
 export function createApi<
   S,
-  Api extends {[name: string]: (store: S, e: any) => S | void}
+  Api extends {[name: string]: ((store: S, e: any) => (S | void))}
 >(
   store: Store<S>,
   api: Api,
 ): {
-  [K in keyof Api]: ((store: S, e: void) => S) extends Api[K]
+  [K in keyof Api]: ((store: S, e: void) => (S | void)) extends Api[K]
     ? Event<void>
-    : Api[K] extends (() => S)
+    : Api[K] extends ((store: S) => (S | void))
     ? Event<void>
-    : Api[K] extends (store: S, e: infer E) => S
+    : Api[K] extends ((store: S, e: infer E) => (S | void))
     ? Event<E extends void ? Exclude<E, undefined> | void : E>
     : any
 }


Test patch:
diff --git a/src/types/__tests__/effector/createApi.test.ts b/src/types/__tests__/effector/createApi.test.ts
index fad5a668..4b7ce78b 100644
--- a/src/types/__tests__/effector/createApi.test.ts
+++ b/src/types/__tests__/effector/createApi.test.ts
@@ -184,7 +184,7 @@ test('optional return (should pass)', () => {
   `)
 })
 
-test('optional return false-positive check (should fail)', () => {
+test('optional return false-positive check (should pass)', () => {
   const playerPosition = createStore(0)
   const api = createApi(playerPosition, {
     moveRight(pos, n: number) {
@@ -199,7 +199,12 @@ test('optional return false-positive check (should fail)', () => {
 
   expect(typecheck).toMatchInlineSnapshot(`
     "
-    no errors
+    The 'this' context of type '{ moveRight: Event<number>; }' is not assignable to method's 'this' of type '\\"Error: Expected 1 argument, but got 0\\"'.
+    No overload matches this call.
+      Overload 1 of 2, '(payload: number): number', gave the following error.
+        Argument of type 'string' is not assignable to parameter of type 'number'.
+      Overload 2 of 2, '(this: \\"Error: Expected 1 argument, but got 0\\", payload?: number | undefined): void', gave the following error.
+        The 'this' context of type '{ moveRight: Event<number>; }' is not assignable to method's 'this' of type '\\"Error: Expected 1 argument, but got 0\\"'.
     "
   `)
 })
Repository: effector/effector
Pull request #497 (2021-06-18 13:05:00)

fix store.on tuple type inference


Patch:
diff --git a/packages/effector/index.d.ts b/packages/effector/index.d.ts
index 51b4d71e..b898a5ee 100644
--- a/packages/effector/index.d.ts
+++ b/packages/effector/index.d.ts
@@ -180,6 +180,8 @@ export interface Effect<Params, Done, Fail = Error> extends Unit<Params> {
   sid: string | null
   shortName: string
 }
+type InferValueFromTupleOfUnits<T extends Tuple<Unit<any>>> =
+  T[number] extends Unit<infer R> ? R : never
 
 export interface Store<State> extends Unit<State> {
   reset(...triggers: Array<Unit<any>>): this
@@ -195,6 +197,10 @@ export interface Store<State> extends Unit<State> {
     triggers: Unit<E>[],
     reducer: (state: State, payload: E) => State | void,
   ): this
+  on<E extends Tuple<Unit<any>>>(
+    triggers: E,
+    reducer: (state: State, payload: InferValueFromTupleOfUnits<E>) => State | void,
+  ): this
   off(trigger: Unit<any>): this
   subscribe(listener: Observer<State> | ((state: State) => any)): Subscription
   updates: Event<State>


Test patch:
diff --git a/src/types/__tests__/effector/store.test.ts b/src/types/__tests__/effector/store.test.ts
index b9c1c4fa..40b5f9da 100644
--- a/src/types/__tests__/effector/store.test.ts
+++ b/src/types/__tests__/effector/store.test.ts
@@ -176,20 +176,15 @@ test('#on triggers[] (should pass)', () => {
   `)
 })
 
-test('#on triggers[] failing', () => {
+test('#on triggers[] non-intersecting types (should pass)', () => {
   const event = createEvent<number>()
   const another = createStore('')
   const store = createStore(0)
-  //@ts-expect-error
+
   store.on([event, another], (state, payload) => state)
   expect(typecheck).toMatchInlineSnapshot(`
     "
-    No overload matches this call.
-      Overload 1 of 2, '(trigger: Unit<unknown>, reducer: (state: number, payload: unknown) => number | void): Store<number>', gave the following error.
-        Argument of type '(Store<string> | Event<number>)[]' is not assignable to parameter of type 'Unit<unknown>'.
-          Type '(Store<string> | Event<number>)[]' is missing the following properties from type 'Unit<unknown>': kind, __
-      Overload 2 of 2, '(triggers: Unit<string>[], reducer: (state: number, payload: string) => number | void): Store<number>', gave the following error.
-        Type 'Event<number>' is not assignable to type 'Unit<string>'.
+    no errors
     "
   `)
 })
Repository: effector/effector
Pull request #871 (2023-03-15 14:41:47)

Fix Gate component 
### Conventions
- [ ] Please check your messages [against the guidelines](https://cbea.ms/git-commit/) if not, perform [interactive rebase](https://thoughtbot.com/blog/git-interactive-rebase-squash-amend-rewriting-history)
- [ ] [Link an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) your pull request closes or relates



Patch:
diff --git a/src/react/createGate.ts b/src/react/createGate.ts
index c98c00c6..34d1c714 100644
--- a/src/react/createGate.ts
+++ b/src/react/createGate.ts
@@ -2,6 +2,7 @@ import {createStore, launch, Domain, createEvent} from 'effector'
 import {Gate} from './index.h'
 import {withDisplayName} from './withDisplayName'
 import {useGateBase} from './apiBase'
+import {getScope} from './scope'
 import {flattenConfig, processArgsToConfig} from '../effector/config'
 import {isObject} from '../effector/is'
 
@@ -64,7 +65,7 @@ export function createGateImplementation<State>({
     })
   }
   function GateComponent(props: State) {
-    useGateHook(GateComponent as any, props)
+    useGateHook(GateComponent as any, props, getScope())
     return null
   }
   GateComponent.open = open


Test patch:
diff --git a/src/react/__tests__/base/createGate.test.tsx b/src/react/__tests__/base/createGate.test.tsx
index decb2299..b6d0ef90 100644
--- a/src/react/__tests__/base/createGate.test.tsx
+++ b/src/react/__tests__/base/createGate.test.tsx
@@ -1,16 +1,18 @@
 import * as React from 'react'
 //@ts-expect-error
 import {render, cleanup, container, act} from 'effector/fixtures/react'
-import {createGate, useGate, useStore} from 'effector-react'
+import {createGate, useGate, useStore, Provider} from 'effector-react'
 import {createGate as createGateScope} from 'effector-react/scope'
 
 import {argumentHistory} from 'effector/fixtures'
 import {
   allSettled,
+  createEffect,
   createEvent,
   createStore,
   fork,
   forward,
+  sample,
   serialize,
 } from 'effector'
 
@@ -218,6 +220,30 @@ test('gate should be correctly serialized via fork #672', async () => {
   expect(states[Gate.state.sid!]).toBe('another')
 })
 
+test('gate component should be isomorphic to scope', async () => {
+  const Gate = createGate('default')
+  const logged = jest.fn()
+  const logFx = createEffect(() => {})
+
+  sample({
+    clock: Gate.open,
+    target: logFx,
+  })
+
+  const scope = fork({
+    handlers: [[logFx, () => logged('scoped')]],
+  })
+
+  await render(
+    <Provider value={scope}>
+      <Gate />
+    </Provider>,
+  )
+
+  expect(logged).toBeCalledTimes(1)
+  expect(logged).toBeCalledWith('scoped')
+})
+
 test('gate properties hook', async () => {
   const Gate = createGate('gate properties')
   const fn1 = jest.fn()
Repository: effector/effector
Pull request #898 (2023-05-13 15:39:32)

Fix same sid handlers resolving

codeflowapp[bot]: <a href="https://stackblitz.com/~/github.com/effector/effector/pull/898"><img src="https://developer.stackblitz.com/img/review_pr_small.svg" alt="Review PR in StackBlitz Codeflow" align="left" width="103" height="20"></a> _Run & review this pull request in [StackBlitz Codeflow](https://stackblitz.com/~/github.com/effector/effector/pull/898)._


Patch:
diff --git a/src/effector/createEffect.ts b/src/effector/createEffect.ts
index da204f64..cf0ce538 100644
--- a/src/effector/createEffect.ts
+++ b/src/effector/createEffect.ts
@@ -100,9 +100,9 @@ export function createEffect<Params, Done, Fail = Error>(
           let handler: Function = scope_.handler
           const scope = getForkPage(stack)
           if (scope) {
-            const scopeHandler = instance.sid
-              ? scope.handlers.sidMap[instance.sid]
-              : scope.handlers.unitMap.get(instance)
+            const scopeHandler =
+              scope.handlers.unitMap.get(instance) ||
+              scope.handlers.sidMap[instance.sid!]
             if (scopeHandler) handler = scopeHandler
           }
           upd.handler = handler


Test patch:
diff --git a/src/effector/__tests__/fork/fork.test.ts b/src/effector/__tests__/fork/fork.test.ts
index 113bb62e..28649a78 100644
--- a/src/effector/__tests__/fork/fork.test.ts
+++ b/src/effector/__tests__/fork/fork.test.ts
@@ -470,6 +470,30 @@ describe('fork handlers support', () => {
 
     expect(scope.getState(acc)).toEqual(['fn'])
   })
+  test('handlers as a tuple list, but with sid doubles', async () => {
+    const h1 = jest.fn()
+    const h2 = jest.fn()
+    const fx1 = createEffect({
+      sid: 'fx',
+      handler: () => {},
+    })
+    const fx2 = createEffect({
+      sid: 'fx',
+      handler: () => {},
+    })
+
+    const scope = fork({
+      handlers: [
+        [fx1, h1],
+        [fx2, h2],
+      ],
+    })
+
+    await Promise.all([allSettled(fx1, {scope}), allSettled(fx2, {scope})])
+
+    expect(h1).toBeCalledTimes(1)
+    expect(h2).toBeCalledTimes(1)
+  })
 })
 
 describe('handlers validation', () => {