# Session duration best practices and missing notes during session close and open

**URL:** <https://discuss.blues.com/t/session-duration-best-practices-and-missing-notes-during-session-close-and-open/3232>\
**Category:** Notehub.io\
**Created:** [August 6, 2025, 11:32pm UTC](https://discuss.blues.com/t/session-duration-best-practices-and-missing-notes-during-session-close-and-open/3232 "2025-08-06T23:32:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scavoj](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@scavoj](https://discuss.blues.com/u/scavoj)\
**Post date:** [August 6, 2025, 11:32pm UTC](https://discuss.blues.com/t/session-duration-best-practices-and-missing-notes-during-session-close-and-open/3232/1 "2025-08-06T23:32:41Z")

</div>

I’m having an intermittent issue. I have the notecard running in continuous mode with immediate syncs. I currently have the session duration set to 24 hours (but I believe had the issue with no duration set). I also have 2 routes: One to Blynk and another which is a web.get which sends over a logEvent over to Blynk to have Blynk send me an email.

The Issue occurs when I send a note to notehub around the same time that the session close/open happens.

{“closed”:true,“why”:“notecard ended the session”}

{“opened”:true,“why”:“continuous connection mode; periodic inbound sync due”}

Sometimes if the note is added (and synced) what I believe to be in between the session close/open, it seems to queue the note and complete the process after the new session begins. Other times it will, for example, execute the route to Blynk successfully and miss the web.get route (i.e., it will update the Blynk UI/app and miss sending me an email).

Is there a session “best practices” document somewhere? Something that goes into the management of sessions?

Thanks,

Joe

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [August 8, 2025, 2:37pm UTC](https://discuss.blues.com/t/session-duration-best-practices-and-missing-notes-during-session-close-and-open/3232/3 "2025-08-08T14:37:21Z")

</div>

Hi @scavoj ,

All `web` requests require a continuous and active connection to Notehub. If you try and execute one while there is no connection or while it’s resetting, it just won’t happen. I would recommend changing your logic to check for an active connection prior to executing the `web.get` for example with [hub.status](https://dev.blues.io/api-reference/notecard-api/hub-requests/latest/#hub-status).

Rob

---

<div class="post-metadata">

**Author:** ![scavoj](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@scavoj](https://discuss.blues.com/u/scavoj)\
**Post date:** [August 8, 2025, 4:36pm UTC](https://discuss.blues.com/t/session-duration-best-practices-and-missing-notes-during-session-close-and-open/3232/4 "2025-08-08T16:36:43Z")

</div>

Thanks, Rob. Is there a best duration setting for sessions? What would be the reason I would want to make the duration longer (or shorter)?

Thanks,

Joe

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [August 8, 2025, 4:58pm UTC](https://discuss.blues.com/t/session-duration-best-practices-and-missing-notes-during-session-close-and-open/3232/5 "2025-08-08T16:58:20Z")

</div>

Hi @scavoj ,

You don’t need to set a session duration to reset your session. The benefit of setting one is that it lets you measure metrics like data usage and Notes synced on a consistent schedule. If you’re not tracking those metrics, you can omit that argument or reset it like so:

```auto
{
  "req": "hub.set",
  "duration": -1
}

```
