[
https://issues.apache.org/jira/browse/UNOMI-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Don Hinshaw updated UNOMI-174:
------------------------------
Description:
in the javascript contained in wab/src/webapp/index.html at line 46, we request
the context from the server.
If there is no cookie or session Id, then that call fails.
After clicking the "tweet" button we reach line 75 in the js, and that checks
cxs for the sessionId before creating a new one.
Since we failed to get the context on page load, cxs isn't defined and throws
an exception. Execution stops there.
I changed line 75 to the code below and I was able to load the context and get
a session after clicking tweet.
{code:java}
var sessionId;
try {
sessionId = cxs.sessionId;
} catch (e) {
sessionId = generateUUID();
}
{code}
was:
in the javascript contained in index.html in wab/src/webapp in the
self-executing function at line 46 we request the context from the server.
If there is no cookie or session Id, then that call fails.
After clicking the "tweet" button we reach line 75 in the js, and that checks
cxs for the sessionId before creating a new one.
Since we failed to get the context on page load, cxs isn't defined and throws
an exception. Execution stops there.
I changed line 75 to the code below and I was able to load the context and get
a session after clicking tweet.
{code:java}
var sessionId;
try {
sessionId = cxs.sessionId;
} catch (e) {
sessionId = generateUUID();
}
{code}
> Twitter Sample Bug
> ------------------
>
> Key: UNOMI-174
> URL: https://issues.apache.org/jira/browse/UNOMI-174
> Project: Apache Unomi
> Issue Type: Bug
> Reporter: Don Hinshaw
> Priority: Minor
>
> in the javascript contained in wab/src/webapp/index.html at line 46, we
> request the context from the server.
> If there is no cookie or session Id, then that call fails.
> After clicking the "tweet" button we reach line 75 in the js, and that checks
> cxs for the sessionId before creating a new one.
> Since we failed to get the context on page load, cxs isn't defined and throws
> an exception. Execution stops there.
> I changed line 75 to the code below and I was able to load the context and
> get a session after clicking tweet.
>
> {code:java}
> var sessionId;
> try {
> sessionId = cxs.sessionId;
> } catch (e) {
> sessionId = generateUUID();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)