# \[Bug-11644\] Gateway Receives Events For Missing Views

**URL:** <https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866>\
**Category:** Ignition Early Access\
**Created:** [November 14, 2018, 7:08pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866 "2018-11-14T19:08:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 14, 2018, 7:08pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/1 "2018-11-14T19:08:07Z")

</div>

Missed one in the Coordinate Container, now down to:

INFO | jvm 1 | 2018/11/14 12:06:38 | I [p.ClientSession] [19:06:38]: Socket connected to session. pageId=37fc0a87 session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 12:06:38 | I [p.ClientSession] [19:06:38]: Client re-synchronizing. protocol=re-sync-views, session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 12:06:58 | W [p.ClientSession] [19:06:58]: Received event for missing view “Navigation@C” project=Perspective\_Scan, session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 12:07:01 | W [p.ClientSession] [19:07:01]: Received event for missing view “Navigation@C” project=Perspective\_Scan, session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 12:07:02 | I [P.InternalDatabase] [19:07:02]: Creating auto-backup of internal database “config.idb”…  
INFO | jvm 1 | 2018/11/14 12:07:02 | I [P.InternalDatabase] [19:07:02]: Created auto-backup of internal database “config.idb” in 228 ms  
INFO | jvm 1 | 2018/11/14 12:07:03 | W [p.ClientSession] [19:07:03]: Received event for missing view “Navigation@C” project=Perspective\_Scan, session-project=Perspective\_Scan

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 14, 2018, 7:55pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/2 "2018-11-14T19:55:26Z")

</div>

I went ahead and opened a bug for this, as the behavior is unexpected.

[Log\_On.JSON](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6c592f1c38cf1783d2297a91f3071f9865de7861.JSON) (3.6 KB)  
[Navigate.JSON](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c1c3e47ba021e91a96602ece7fcbc7cc71cf9ce6.JSON) (5.9 KB)

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 14, 2018, 9:41pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/3 "2018-11-14T21:41:05Z")

</div>

Perhaps I didn’t follow the diagram on Perspective structure as closely as I thought?  
[https://docs.inductiveautomation.com/display/DOC80/Perspective](https://docs.inductiveautomation.com/display/DOC80/Perspective)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 14, 2018, 10:24pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/4 "2018-11-14T22:24:06Z")

</div>

No, your structure has some unnecessary pieces\*, but there’s no reason those Views should generate the warning that they are indeed generating.

\*You’re passing a parameter as part of your navigation, but the View you’re navigating to doesn’t “take” parameters (your View correctly ignores them).

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 14, 2018, 10:26pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/5 "2018-11-14T22:26:42Z")

</div>

check… deleting unused parameters 😃

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 14, 2018, 10:38pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/6 "2018-11-14T22:38:24Z")

</div>

Do these first couple lines apply to the situation? I am attempting to run this on the perspective app on my iPhone 8 Plus using iOS version 12.1(16B92)

INFO | jvm 1 | 2018/11/14 15:31:35 | W [P.Session] [22:31:35]: Attempted mobile device validation on non-mobile session. route-group=perspective, route-path=/hello/:project\_version/:project\_name/:tab\_id/:device\_response  
INFO | jvm 1 | 2018/11/14 15:31:39 | I [P.Routes] [22:31:39]: Encoded Message = AAAAEByXSiYP7RSyjewV0Qt0yw3tkVGC2IkIOQxy0r7SKOQb9Cr08iMe3saTLPUf7-h8C2KEfwtgtNhVIEB7CaBvHTg= route-group=perspective, route-path=/challenge  
INFO | jvm 1 | 2018/11/14 15:31:41 | I [p.ClientSession] [22:31:41]: Socket connected to session. pageId=37fc0a87 session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 15:31:42 | I [p.ClientSession] [22:31:42]: Client Starting. Project=‘Perspective\_Scan’. protocol=client-start, session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 15:31:59 | W [p.ClientSession] [22:31:59]: Received event for missing view “Navigation@C” project=Perspective\_Scan, session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 15:32:07 | W [p.ClientSession] [22:32:07]: Received event for missing view “Navigation@C” project=Perspective\_Scan, session-project=Perspective\_Scan  
INFO | jvm 1 | 2018/11/14 15:32:13 | W [p.ClientSession] [22:32:13]: Received event for missing view “Navigation@C” project=Perspective\_Scan, session-project=Perspective\_Scan

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 15, 2018, 4:22pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/7 "2018-11-15T16:22:27Z")

</div>

I was stepping through the process and watching the wrapper.log file this morning and I noticed something.  
the “view missing” message does not hit the wrapper.log until I navigate away from my Main\_Views/Navigation view to the Material\_User/Log\_On view.

The Log\_On view Back Button does have an onClick event to take the users back to the Main\_Views/Navigation view. This will also apply to other views to assist with the user navigation through the app…  
.  
Could I be getting this message because it is looking for a view to be present that has been sent to garbage collection (GC) or that is connected to a page that has been sent to GC?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 15, 2018, 4:43pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/8 "2018-11-15T16:43:26Z")

</div>

Not likely - it would be a tremendous waste of computing resources to scan everything about a View and make sure it’s all going to work before we need to use it.

As there’s no adverse effects that seem to be stemming from this “missing view” I wouldn’t worry too much about it, but if you want to investigate further you could always provide some logging as a way to lock-down exactly what is happening and when.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 15, 2018, 5:35pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/9 "2018-11-15T17:35:40Z")

</div>

While investigating this issue further, I’ve found that use of the system.perspective.navigate() method does not encounter the “missing view” issue.

I also encountered a different issue during the course of my investigation that is leading me to recommend that you switch to using the system.perspective.navigate() method, and that issue is that Script Actions don’t seem to be executing when paired with a Navigate Action.

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 15, 2018, 5:58pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/10 "2018-11-15T17:58:15Z")

</div>

So would this be a temporary case of “either/or” usage or should this be resolved later in a future build?

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 15, 2018, 6:07pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/11 "2018-11-15T18:07:16Z")

</div>

Removing the Navigate event also helped resolve my label text not changing due to not updating from the session.custom.key.value

In the “User Log On” Button:  
Emp\_Role = ‘Operator’  
self.session.custom.Emp\_Role = Emp\_Role  
system.perspective.navigate(view=‘Material\_User/Log\_On’)

And in the “Back Button”:  
Emp\_Role = ‘’  
self.session.custom.Emp\_Role = Emp\_Role  
system.perspective.navigate(view=‘Main\_Views/Navigation’)

In the onStartup script for the Navigation View:  
Emp\_Role = ‘’  
badge = ‘’  
PW = ‘’   
self.session.custom.Emp\_Role = Emp\_Role  
self.session.custom.badge = badge  
self.session.custom.PW = PW

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 15, 2018, 6:18pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/12 "2018-11-15T18:18:46Z")

</div>

Right, that’s because the Script Action was being ignored while using the Navigate Action. Moving to the Script Action with a navigation **method** will suffice as a workaround for now as the Script Action will now appropriately set the desired variables.

Side note:  
If your Navigation View will always set the Session variables onStartup, you don’t need to set them before navigating to it, and you actually _shouldn’t_ set them before navigating, as it will only make your personal debugging more difficult.

---

<div class="post-metadata">

**Author:** ![PerryAJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/perryaj/32/3281_2.png) [@PerryAJ](https://forum.inductiveautomation.com/u/PerryAJ)\
**Post date:** [November 15, 2018, 6:19pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/13 "2018-11-15T18:19:06Z")

</div>

Cody is doing a great job in helping identify and track these issues, so I don’t have anything to add there. Just wanted to say thanks for providing such helpful reports Brian. These really help us deliver a more polished product come final release.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 15, 2018, 6:19pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/14 "2018-11-15T18:19:59Z")

</div>

This is something that we MUST fix; there should be no discernible difference in behavior regardless of which Action you choose to take.

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 15, 2018, 6:23pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/15 "2018-11-15T18:23:33Z")

</div>

So would there be a better method for making sure that the Emp\_Role session variable is reset when users go back to the Navigation screen? I was assuming that if a standard user was done and a Quality Engineer needed to use the same device, I should reset that role variable to null and then allow the selection based on the log on. (BTW, that role is a database defined role with permissions, _not_ an Ignition or gateway/project type role.)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 15, 2018, 6:33pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/16 "2018-11-15T18:33:40Z")

</div>

Design in these situations is different for everyone, but if your desire is that whenever you visit this Navigation View those three variables are se to empty Strings, then your onStartup script is 100% correct.

I was only noting that the button which triggers navigation to your Navigation View is performing `session.custom.Emp_Role = ''`, and then immediately when the new View comes into existence it performs the same action again.

If you ever modify the script for the button which does the navigation and say perform `session.custom.Emp_Role = null`, no `null` checks in scripts or bindings on the Navigation View will ever come back as True, because that `null` value has already been overridden with the empty String.

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 15, 2018, 6:42pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/17 "2018-11-15T18:42:30Z")

</div>

Ok, so that is a View onStartup event, not a Session onStartup event…

And then every time I navigate back to the Navigation view it will run the script as soon as it instantiates, correct?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 15, 2018, 6:47pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/18 "2018-11-15T18:47:33Z")

</div>

Correct.

Perspective Views do not “exist” unless they are open (which is why you can’t bind against properties in other Views), so a Session onStartup Script will fire once - as soon as your Session starts.

View onStartup Scripts will fire every time the View “loads”, whether this is through Navigation Actions, the `perspective.navigate()` method in a Script Action, or using your browser’s back button (remember, “pages” are still Views).

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 27, 2018, 5:39pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/19 "2018-11-27T17:39:56Z")

</div>

Any kind of ETA on this yet?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 27, 2018, 5:57pm UTC](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866/20 "2018-11-27T17:57:28Z")

</div>

If you’re inquiring about ticket 11644 - which is the open ticket about a difference in behavior between using the navigate method and the navigate action - there is no ETA.

[Next page](https://forum.inductiveautomation.com/t/bug-11644-gateway-receives-events-for-missing-views/20866.md?page=2)
