# \[BUG\] Saving changes to script libraries doesn't push updates to Perspective sessions

**URL:** <https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 13, 2023, 5:02am UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293 "2023-07-13T05:02:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 13, 2023, 5:02am UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/1 "2023-07-13T05:02:30Z")

</div>

v8.1.28

When making changes to scripts that are called by Perspective component actions, if you don't edit a Perspective View as well before you save, the script changes aren't pushed to the session, and clicking on buttons that call these edited scripts will still run the old ones.

On a side note, this doesn't really make sense to me, since the scripts are run on the gateway, not the sessions... I'd really like to understand why this is the case

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 13, 2023, 12:39pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/2 "2023-07-13T12:39:31Z")

</div>

I would presume the sessions are holding onto the old ScriptManager. Sounds like a bug.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 13, 2023, 3:16pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/3 "2023-07-13T15:16:50Z")

</div>

This is a bug that we've already fixed, but it's awaiting QA. Expect the fix in 8.1.30 or .31, probably.

---

<div class="post-metadata">

**Author:** ![jacob\_geers](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jacob\_geers](https://forum.inductiveautomation.com/u/jacob_geers)\
**Post date:** [August 4, 2025, 7:05pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/4 "2025-08-04T19:05:49Z")

</div>

I still have this issue in 8.1.48. It is annoying when developing, but I am more concerned that this might happen when "pushing code to prod" with 200 clients open and only half getting the updated script?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 4, 2025, 7:07pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/5 "2025-08-04T19:07:13Z")

</div>

You should contact our support department officially ([https://support.inductiveautomation.com/hc/en-us](https://support.inductiveautomation.com/hc/en-us)) so they can work with you to isolate the problem and we can get it fixed. We haven't had any other reports of the issue since around the time Nick reported it here.

---

<div class="post-metadata">

**Author:** ![oliver.bernhard](https://avatars.discourse-cdn.com/v4/letter/o/e95f7d/32.png) [@oliver.bernhard](https://forum.inductiveautomation.com/u/oliver.bernhard)\
**Post date:** [September 29, 2025, 12:54pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/6 "2025-09-29T12:54:26Z")

</div>

@jacob_geers: Did you resolve the issue? We’ve been running into the same problem…

---

<div class="post-metadata">

**Author:** ![jacob\_geers](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jacob\_geers](https://forum.inductiveautomation.com/u/jacob_geers)\
**Post date:** [September 29, 2025, 1:08pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/7 "2025-09-29T13:08:55Z")

</div>

I created a support ticket #156038 with a video of the issue and some gateway backups but support could not reproduce the issue. Their idea was that threads were being blocked when attempting to push the changes over to the session from the gateway. Next step was to take thread dumps at 3sec intervals when the issue happens, but I haven’t spend time on it since.

---

<div class="post-metadata">

**Author:** ![oliver.bernhard](https://avatars.discourse-cdn.com/v4/letter/o/e95f7d/32.png) [@oliver.bernhard](https://forum.inductiveautomation.com/u/oliver.bernhard)\
**Post date:** [September 30, 2025, 5:25am UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/8 "2025-09-30T05:25:22Z")

</div>

@jacob_geers : Thanks for sharing!  
@paul-griffith : I’m not sure if opening another ticket on my end with IGNITION Support would be of much help. Although no heap thread dumps have been provided by **jacob\_geers** , I doubt I would be able to provide them in time either, as I don’t have direct access to the server where the Gateway is running. The process of obtaining the necessary permissions is quite strenuous—unless there’s a built-in function within the Designer that could be utilized for this purpose.

Given this, I hope you don’t mind me asking—do you have any new insight on whether this previous bug might still be unresolved?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 30, 2025, 6:58pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/9 "2025-09-30T18:58:02Z")

</div>

The original bug Nick reported is fixed and I haven't heard any (other) reports of a regression besides you and Jacob. Contacting support is my recommendation because I'm just a developer who spends (too much) time on the forums - I'm not at all getting a representative sample, and maybe in support they're dealing with this every week. I doubt it, and I'd assume that if they are experiencing a lot of issues with this they'd have raised another internal bug ticket, but 🤷  
The point is data collection in the centralized location that deals with customer reported issues.

You can't really debug an issue with the gateway's internal state from the designer, because they're entirely separate processes.

The _most likely_ explanation, to my mind, is a different bug, distinct from what Nick originally reported, that you and Jacob have managed to get into.  
Do you happen to be using `import` statements in your Python code to bring in project library code? That's fundamentally flawed in 8.1 and all prior versions (fixed in 8.3, though still not recommended):

> [@\[IGN-6503\]Project Library Script Initialization Races](https://forum.inductiveautomation.com/t/ign-6503-project-library-script-initialization-races/98636):
>
> Are you annoyed by pseudo-random breakage in Ignition project library scripting? Odd top-level constants being garbled, or operations in the top level that have side effects running twice? Or more? Not happening much, but always around project edits, and sometimes even on gateway restart? Yeah, me too. frowning_face Poking around under the hood back in the spring, for a module development task, I ran across some problematic IA bytecode and pinged some people. But it went nowhere, as I co…

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 30, 2025, 7:24pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/10 "2025-09-30T19:24:38Z")

</div>

> [@paul-griffith](#):
>
> Do you happen to be using `import` statements in your Python code to bring in project library code? That's fundamentally flawed in 8.1 and all prior versions (fixed in 8.3, though still not recommended)

Note that cross-library `import` is not necessary to trigger this bug, but raises the likelihood of the race condition, and especially raises the chance of deadlock if you try the workaround in that topic.

Multiple gateway or client events racing at scripting startup is the primary cause, exacerbated if any initialization code is time consuming.

The fix in v8.3 covers both the initialization race and covers the work-around's deadlock risk. **Don't use the work-around in v8.3.**

The fix in v8.3 will have a performance impact on **all** uses of `import` that run in parallel with script init. Using `import` anywhere in Ignition other than the outer level of project library scripts is already disastrous for performance, but v8.3 puts an exclamation point on it.

(If you are using import anywhere in an event script or inside any `def`, you are screwing up.)

---

<div class="post-metadata">

**Author:** ![oliver.bernhard](https://avatars.discourse-cdn.com/v4/letter/o/e95f7d/32.png) [@oliver.bernhard](https://forum.inductiveautomation.com/u/oliver.bernhard)\
**Post date:** [October 1, 2025, 12:26pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/11 "2025-10-01T12:26:56Z")

</div>

Thanks for the detailled response Pete and Paul!

Indeed, we’re working with `import`quite a lot. Since we aim to "outsource" code as much as possible for easier maintenance, using the `import` function seems like the best approach.

For example:

```python
import time  
import java.lang.Exception  
from functions import ....  

```

So, I don’t see any other way to continue with this approach other than by using `import`…

Just to clarify—if we were to upgrade to version 8.3, would this issue be resolved?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 1, 2025, 12:34pm UTC](https://forum.inductiveautomation.com/t/bug-saving-changes-to-script-libraries-doesnt-push-updates-to-perspective-sessions/76293/12 "2025-10-01T12:34:00Z")

</div>

> [@oliver.bernhard](#):
>
> So, I don’t see any other way to continue with this approach other than by using `import`…

Use `import` as needed in the outermost level of code in your project library scripts, so the import occurs during initialization.

Do not use `import` pointing at other project library scripts. Simply use fully-qualified references (project library scripts are auto-imported).

Do not use `import` anywhere inside any function or class definitions, nor in any other event scripts.

Yes, upgrading to v8.3 will fix all of the initialization races and the corrupted objects and memory leaks that are associated. The above guide for `import` still applies, due to the performance hit of repeatedly taking the import lock.

_Psssst!_ Don't ever `import time`. Don't use jython's stdlib for anything where Ignition provides appropriate functions, or java provides appropriate functions. `time` is one of the stdlib modules that should **never** be used in Ignition.
