ngx-rendering-service-lib 0.0.66931 → 0.0.66932

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,6 +55,7 @@ const handleSessionRequest = async (request) => {
55
55
  return handleStandardRequest(request)
56
56
  })
57
57
  const sessionId = await retrieveSessionIdFromDb()
58
+ console.log("[Service Worker] session request. Retrieved session id from DB: " + sessionId)
58
59
  if (sessionId === "") {
59
60
  return handleStandardRequest(request)
60
61
  }
@@ -78,12 +79,15 @@ const handleSessionRequest = async (request) => {
78
79
  */
79
80
  const handleRenderDataRequest = async (request) => {
80
81
  await getDb().catch(error => {
82
+ console.log("[Service Worker] Error getting DB.")
81
83
  console.error(error)
82
84
  return handleStandardRequest(request)
83
85
  })
84
86
  const existingSessionId = await retrieveSessionIdFromDb()
85
87
  const modifiedHeaders = new Headers(request.headers)
86
88
  if (existingSessionId !== "") {
89
+ console.log("[Service Worker] Existing session id found. Adding to request headers: " +
90
+ SESSION_HEADER_NAME + "=" + existingSessionId)
87
91
  modifiedHeaders.set(SESSION_HEADER_NAME, existingSessionId)
88
92
  }
89
93
  const modifiedRequest = new Request(request, {
@@ -91,6 +95,8 @@ const handleRenderDataRequest = async (request) => {
91
95
  });
92
96
  const response = await fetch(modifiedRequest)
93
97
  const newSessionId = response.headers.get(SESSION_HEADER_NAME)
98
+ console.log("[Service Worker] Response received from Rendering Service. New session id: " + newSessionId + ". Existing session id: " + existingSessionId + ".")
99
+
94
100
  if (newSessionId !== null && newSessionId !== "" && newSessionId !== existingSessionId) {
95
101
  await storeSessionIdToDb(newSessionId)
96
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-rendering-service-lib",
3
- "version": "0.0.66931",
3
+ "version": "0.0.66932",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "tslib": "^2.3.0"