[2.0.47] Pasting space platform hub cancels enabled requests

Post your bugs and problems so we can fix them.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 785
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

[2.0.47] Pasting space platform hub cancels enabled requests

Post by Hares »

Steps to Reproduce
  1. Have a space platform with enabled requests via groups, named or anonymous
  2. Copy space platform hub
  3. Paste space platform hub onto itself
Expected:
  • Nothing changes
Actual:
  • All active requests group become disabled, regardless of being named or anonymous
  • Undoing does not revert that change
Click to expand the recording
Attachments
2025-04-29 23-38-34.mp4
(7.35 MiB) Downloaded 6 times
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 785
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: [2.0.47] Pasting space platform hub cancels enabled requests

Post by Hares »

To clarify, in case this is working as initially designed: I am OK with the fact new request groups from pasted blueprint are added in a disabled state. However, groups those do already exist in both old state and new state (and especially when having the same multiplier) should remain enabled.

How I discovered this issue -- I copied space platform hub into a blueprint, copied it into a string, and duplicated interrupts via terrible Python code, then pasted updated blueprint on top of that platform. After a few hours I discovered the satellite platform stopped supplying resources because all imports were suspended.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15469
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.47] Pasting space platform hub cancels enabled requests

Post by Rseding91 »

What's the desired outcome with pasting an entity onto itself? Theoretically - do nothing? "it already has the exact settings of the source entity"?
If you want to get ahold of me I'm almost always on Discord.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 785
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: [2.0.47] Pasting space platform hub cancels enabled requests

Post by Hares »

Rseding91 wrote: Tue Apr 29, 2025 8:52 pm What's the desired outcome with pasting an entity onto itself? Theoretically - do nothing? "it already has the exact settings of the source entity"?
Yes.
Also, as I wrote above, I initially discovered this problem when pasted blueprint with schedule being changed, all other settings were kept the same.

However, the different behaviour is observed.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 785
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: [2.0.47] Pasting space platform hub cancels enabled requests

Post by Hares »

Hares wrote: Tue Apr 29, 2025 8:47 pm How I discovered this issue -- I copied space platform hub into a blueprint, copied it into a string, and duplicated interrupts via terrible Python code, then pasted updated blueprint on top of that platform.
If you are curious, this is exactly how blueprint was changed:

Code: Select all

def update_schedule(bp: Blueprint) -> Blueprint:
    assert len(bp['entities']) == 1, "Expected to contain exactly one entity being space platform hub"
    hub = bp['entities'][0]
    assert hub['name'] == 'space-platform-hub', "Expected to receive a space platform hub."
    assert len(bp['schedules']) == 1, "Expected to contain exactly one schedule being space platform hub's schedule"
    interrupts: List[InterruptRecord] = bp['schedules'][0]['schedule']['interrupts']
    # Path('blueprints/data/schedule.json').write_text(json.dumps(interrupts, indent=4))
    
    base_planet = PLANETS[0]
    for route in ROUTES:
        base_route_file = Path('blueprints/data/src/schedule-interrupts') / f'{route}-{_as_id(base_planet)}.json'
        base_route: InterruptRecord = json.loads(base_route_file.read_bytes())
        for planet in PLANETS:
            target_route = replace_planet_in_record(base_route, from_planet=base_planet, to_planet=planet)
            for item in interrupts:
                if (item['name'] == target_route['name']):
                    print(f"Route '{item['name']}' already exists, skipping.")
                    break
            else:
                print(f"Adding Route '{target_route['name']}'...")
                interrupts.append(target_route)
    
    return bp
tinker9
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Nov 09, 2024 4:51 am
Contact:

Re: [2.0.47] Pasting space platform hub cancels enabled requests

Post by tinker9 »

What's the desired outcome with pasting an entity onto itself? Theoretically - do nothing? "it already has the exact settings of the source entity"?
There are two typical use cases here:
- pasting a platform over an empty hub: the goal building the platform. So building ghosts should be prioritised over any requests, or requests should be off.
- pasting a platform over an existing hub: the goal is not to break anything that's already working. So requests that are already on the platform should stay enabled.

There's two ways to satisfy both these goals:
1. when pasting, new requests should be off
2. when pasting, requests should match the settings in the source (like requester chest pasting). But this only works if building ghosts are prioritised.

Number 2 seems more intuitive, because it matches requester chest copy-paste, and it is useful to be able to copy-paste enabled requests.
Post Reply

Return to “Bug Reports”