Comments (16)
Please upgrade to the latest release; Observable.throw
was not included but now it is.
This may solve one problem and reveal another, but let's take this one step at a time.
from botframework-directlinejs.
okay, thanks you, have upgraded to the latest one.
from botframework-directlinejs.
hi, sometimes when i call postActivity, it returns with the id "retry". It seems a problem of directline that when I send msg to directline it returns retry rather than consiation|id like "BwWr2WLPs6a2LaalX4abzC|0000001". Do you have any idea on how it happens? thanks
ps: I use websocket, is it related to websocket close and reopen? I found this log.
from botframework-directlinejs.
That means the call failed but could be retried. I admit this is a poor API choice, will look at cleaning up.
webSocket is used for receiving messages, not sending.
from botframework-directlinejs.
Is this error return by directline API? Is there way to start a new conversation under this condition or how can I handle this error with BotFramework-DirectLineJS ? Any suggestion is appreciated.
from botframework-directlinejs.
This return value means the attempt to post the activity failed, possibly due to timeout or other network conditions. The conversation is still ongoing and doesn't need to be restarted.
from botframework-directlinejs.
Yes, but it seems not a network problem. As long as i restart the service which will start a new conversition then it goes fine again. I guess i need to log out the error msg to find the real cause.
from botframework-directlinejs.
My mistake, I responded from memory without looking at the code.
When postActivity
returns "retry"
it means the access token has expired. If you subscribe
to connectionStatus$
as described in the README you can see it changed to ExpiredToken
.
A token is a short-lived credential you get by calling the tokens/generate
Direct Line endpoint. The only reason to use a token is when you don't want to expose a secret to the outside world, usually in a web page. This isn't a problem on a server. On a server, you probably shouldn't be using tokens. You can just use the Direct Line secret.
Even if you have a reason to use a token on the server, DirectLineJS renews the token every 15 minutes by calling the /tokens/refresh
DirectLine endpoint. So if you are getting this error:
- You are having an extended connectivity problem (one that lasts more than 15 minute), or
- You are creating DirectLineJS by passing the token using the
secret
parameter, which will not trigger the token renewal process
If you are in fact not using tokens, then there is probably a bug in my code.
from botframework-directlinejs.
Thanks for your clue. I use secret to create the directline instance. The problem occurs when it runs more than 15 hours last time. I added some log in your function catchPostError and catchExpiredToken to track what error may cause the problem. It has run more than 7 hours normally. I'll let you know if I reproduce it.
from botframework-directlinejs.
That sounds frustrating. I'm out of ideas for now. This could be a bug in the library (e.g. a memory leak, since it only happens after many hours) or a problem with Direct Line itself. I look forward to hearing what you learn.
from botframework-directlinejs.
update: I was sort of right the first time. That error can mean token issues OR a variety of other errors, including timeout and connectivity errors.
from botframework-directlinejs.
I haven't reproduce the issue yet. It goes fine in these two days, will keep you update.
from botframework-directlinejs.
Hi billba,
I reproduce the issue. It happed when the websocket lost connection, then you will reconnect the websocket immediately. Then after a while when I post msg to directline, it return 403 and the msg "error": {\r\n "code": "TokenExpired",\r\n "message": "Token has expired"\r\n }\r". Then all the subsequent calls will return the same.
I guess the problem is caused by function reconnectToConversation(). You reset the token here which make my secret don't work any more. I read the doc of directline and didn't find any infomation on that. So is it necessary to set that value to replace the secrect?
from botframework-directlinejs.
Ah! You found a bug. We should not be setting this.token
unless this.secret
is undefined. I will fix in the morning. Very sorry for the trouble, thanks for investigating.
from botframework-directlinejs.
Please update to the latest version to get the fix. Thanks again for tracking this down.
from botframework-directlinejs.
Okay, thank you .
from botframework-directlinejs.
Related Issues (20)
- subscribe not working when using react-query HOT 4
- This repo is missing important files
- Automated Tests With BotFramework-DirectLineJS HOT 6
- Whether to support the wechat mini program HOT 1
- Hello, how to send by directline, the ID of my QA environment? HOT 2
- Please create an Offline DirectLine Emulation that is supported by Microsoft.
- DirectlineStreaming doesn't work with Node.js HOT 7
- Error with Power Virtual Agent: Site Missing code 403 from https://directline.botframework.com/v3/directline/conversations HOT 1
- DirectlineStreaming - Retrying connection after end HOT 5
- Update webpack target for modern Node HOT 1
- DirectLineStreaming: unhandled rejection from connectWithRetryAsync in activity$
- While sending attachment, activity API was not triggering using botframework-directlinejs HOT 2
- Post an activity with attachment occurs 502 HOT 3
- Attachements limitation and expiry on DirectLine HOT 1
- DirectlineStreaming: Errors on disconnect are written to console HOT 2
- networkInformation: Switching network type, then switching back again, results in RECONNECT_REJECTED HOT 1
- Angular 15 with botframework-directlinejs does not compile due to typings errors. HOT 3
- [Error] NetworkInformation, missing Interface. HOT 4
- Mocking the WebSocket URL for end to end testing using playwright/cypress. HOT 2
- Application crashes when refresh token returns an error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botframework-directlinejs.