OSF.DDA.Error 9020 on Office.context.mailbox.item.body.getAsync() - outlook

Since a few days we get an error response 9020 on the call Office.context.mailbox.item.body.getAsync. This code used to work flawless. Is there a Microsoft problem?
getMessageBody() {
// call the async function to get the body
Office.context.mailbox.item.body.getAsync(Office.CoercionType.Text,{},
(result) => {
this.entityAnalyzeData.EntityItem.Properties.ContactProperty.Body = String(result.value);
// inform listeners
this.mlBodySubject.next('ok');
}
);
The result is
OSF.DDA.AsyncResult {value: null, status: "failed", error: OSF.DDA.Error}
value: null
status: "failed"
error: OSF.DDA.Error
name: "GenericResponseError"
message: "Er is een interne fout opgetreden."
code: 9020
Thanks in advance for your attention!
Wilco

Related

Lambda#Edge function result failed validation

I have a lambda#edge in Viewer Request that is generating this error:
ERROR Validation error: Lambda function result failed validation, the function tried to add read-only header, headerName : Transfer-Enoding.
I tried to return this event in case of redirection:
const response = {
status: '301',
statusDescription: 'Found',
headers: {
'location': [{
key: 'location',
value: 'https://test.com'
}]
}
}
callback(null, response)
I also tried keeping the same event but I get the same error
const response = event.Records[0].cf.response;
response.status = 301;
response.statusDescription = 'Found';
response.headers['location'] = [{ key: 'Location', value:'https://www.test.com'}];
Cqn someone tells me how to fix this ?
PS: Even requests that pass by this lambda and doesnt verify the redirection condition result in this error also.

How to replay conversation through nodeJs using messagebird WhatsApp Business API?

How to test?
get started from this url: https://developers.messagebird.com/docs/whatsapp/getting-started/
var messagebird = require('messagebird')();
my code
messagebird.conversations.reply(data.id, {
'type': 'image',
'content': {
'image': {
'url': 'https://api.faridblaster.my/test',
'caption': 'Bocaahhh3332'
}
}
}, function (err, response) {
if (err) {
return console.log(err);
}
});
the result show me
Expected Output should be
status: 'delivered',
Thanks in advance!
Based on the provided examples, this is the expected status right after you are sending the message.
If you'd like to monitor the status changes for the message, you will have to register a webhook for the message.updated events and you'll get your updates in the reportURL (details here)

Set cookie in after() hook nightwatch

I tried to set cookie in nightwatch after() hook function but apparently it didn't work. The idea is I want to set the cookie's value as "failed" if the test failed and "success" if the test passed.
export = {
'#tags': [ 'heboh' ],
after(browser) {
browser
.setCookie({ name: 'mycookie', value: 'success' })
.getCookie('mycookie', function callback(result) {
console.log(result); // print null
})
.end();
},
'create heboh'(browser) {
browser
.url('http://www.google.com')
.waitForElementVisible('body', 1000)
.assert.title('Facebook'); // intended to make it failed
}
}
I specified --verbose and this is what I got
FAILED: 1 assertions failed and 1 passed (5.446s)
INFO Request: POST /wd/hub/session/null/cookie
- data: {"cookie":{"name":"mycookie","value":"true"}}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 404 POST /wd/hub/session/null/cookie (19ms) { sessionId: 'null',
value:
{ error: 'invalid session id',
message: 'No active session with ID null',
stacktrace: '' },
status: 6 }
LOG → Completed command cookie (22 ms)
INFO Request: GET /wd/hub/session/null/cookie
- data:
- headers: {"Accept":"application/json"}
INFO Response 404 GET /wd/hub/session/null/cookie (15ms) { sessionId: 'null',
value:
{ error: 'invalid session id',
message: 'No active session with ID null',
stacktrace: '' },
status: 6 }
null
LOG → Completed command cookie (16 ms)
LOG → Completed command end (0 ms)
Looks like there is no session in after() function.
Try this, I believe you need to call done on your after hook.
after: function (browser, done) {
browser
.setCookie({name: 'mycookie', value: 'success'})
.getCookie('mycookie', function callback(result) {
console.log(result);
})
.end()
.perform(function () {
done();
});
}

Error handling in Angular2

I'm working on an Angular 2 service returning data from a restful WebApi backend.
I'm trying to make it gracefully handle the service not being available however I'm getting unexpected information in the error responses.
Here's the code
update(fund, transactionId:string, showToastOnError: boolean, useCorrectUrl: boolean) {
let options = this.getStartCall();
options.headers.append("transaction-id", transactionId)
let url = fundsUrl + (useCorrectUrl ? "" : "breakTheUrl");
return this._http.put(url, JSON.stringify(fund), options)
.map(res => res.json())
//.retry(5)
.catch(errorResponse => {
let res = <Response>errorResponse;
let err = res.json();
let emsg = err ?
(err.error ? err.error : JSON.stringify(err)) :
(res.statusText || 'unknown error');
this._logger.log(emsg, "The fund was not updated", LogLevel.Error, showToastOnError);
return Observable.throw(emsg);
})
.finally(() => this._spinnerService.hide());
}
When I look at the network traffic I see the 404 error as expected.
My problem is in my catch function.
Here's the value's I'm seeing:
JSON.stringify(errorResponse)
{"_body":{"isTrusted":true},"status":200,"statusText":"Ok","headers":{},"type":3,"url":null}"
errorResponse.json()
bubbles: false
cancelBubble: false
cancelable: false
currentTarget: XMLHttpRequest
defaultPrevented: false
eventPhase: 2
isTrusted: true
isTrusted: true
lengthComputable: false
loaded: 0
path: Array[0]
position: 0
returnValue: true
srcElement: XMLHttpRequest
target: XMLHttpRequest
timeStamp: 1460990458693
total: 0
totalSize: 0
type: "error"
__proto__: XMLHttpRequestProgressEvent
Am I doing something wrong here or is this a bug in Angular2 beta 15?
Most of time, you have such a value for an error when the onerror callback is called on the underlying XHR object. See this line in the source code: https://github.com/angular/angular/blob/master/modules/angular2/src/http/backends/xhr_backend.ts#L70.
That said, it shouldn't occur for a 404 status code but rather on an error like net::ERR_NAME_NOT_RESOLVED.
404 status code is handled by the onload callback: https://github.com/angular/angular/blob/master/modules/angular2/src/http/backends/xhr_backend.ts#L37.
I made a test with the beta15 and I can't reproduce your problem.
See this plunkr: https://plnkr.co/edit/SB3KLZlbJT3wm9ATAE0R?p=preview.

Mandrill with parse server not working on heroku migration

I have migrate app from parse.com to heroku with mLab and everything works fine except cloud code.
I am using Mandrill for sending email from parse cloud code which is not working with heroku
Here is what I have done so far:
Installed mandrill ~0.1.0 into parse-server-example and push the code to heroku app
Put the cloud code into '/cloud/main.js'
Called the function from iOS app which respond error as:
[Error]: Invalid function. (Code: 141, Version: 1.13.0).
Here is my code script:
Parse.Cloud.define("sendMail", function(request, response) {
var Mandrill = require('mandrill');
Mandrill.initialize('xxxxxx-xxxxx');
Mandrill.sendEmail({
message: {
text: "ffff",
subject: "hello",
from_email: "xxxxx#gmail.com",
from_name: "pqr",
to: [
{
email: "xxxxxxxxxx#gmail.com",
name: "trump"
}
]
},
async: true
},{
success: function(httpResponse) {
console.log(httpResponse);
response.success("Email sent!");
},
error: function(httpResponse) {
console.error(httpResponse);
response.error("Uh oh, something went wrong");
}
});
});
But after calling 'sendMail' function I am getting this error:
[Error]: Invalid function. (Code: 141, Version: 1.13.0).
================================== MailGun ==========================
Parse.Cloud.define('hello', function(req, res) {
var api_key = 'key-xxxxxxxxxxxxxx';
var domain = 'smtp.mailgun.org';
var mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});
var data = {
from: 'xxxxxxxald#gmail.com',
to: 'xxxxx8#gmail.com',
subject: 'Hello',
text: 'Testing some Mailgun awesomness!'
};
mailgun.messages().send(data, function (error, body) {
console.log(body);
});
//res.success(req.params.name);
});
I had a similar problem with sendgrid, but I finally find a way around the problem.
I think this steps may help you,
Miss some brackets or some code separator? ( try rewritting the entire code in the main.js )
The app is actually running? ( when you type "heroku open" in the terminal you get the default message? ) - if not check step 1.
If the previous are not working, rollback to a safe build and Add the add-ons in the heroku dashboard instead of installing them yourself, then download the git and do any changes to git and then push.
Below I have pasted from cloud code main.js code that is working using Mandrill on heroku parse application to send password recovery e-mail.
in cloud code main.js:
var mandrill_key = process.env.MANDRILL_KEY;
var Mandrill = require('mandrill-api/mandrill');
var mandrill_client = new Mandrill.Mandrill(mandrill_key);
{
success: function(gameScore) {
//alert('New object created with objectId: ' + gameScore.id);
mandrill_client.messages.send(
{
message: {
html: "<p>Hello " + firstUser.get('fullname') + ",</p><p>We received your request to reset your password.</p><p>Your user name is <strong>" + firstUser.get('username') + "</strong>. Please click here to create a new password. This link will expire in one hour after this mail was sent</p><p>If you need additional help, just let us know.</p><p>SampleCompany Support<br>customerservice#example.com</p><p>Copyright Sample Company, Inc. 2014-2017</p>",
subject: "Sample Company Name account recovery",
from_email: "customerservice#example.com",
from_name: "Sample Company Name",
to: [
{
email: firstUser.get('email'),
name: firstUser.get('fullname')
}
]
},
async: true
},
//Success
function(httpResponse) {
console.log(httpResponse);
//alert("Email sent!");
},
//Failure
function(httpResponse) {
console.error(httpResponse);
//alert("Uh oh, something went wrong");
});
},
error: function(gameScore, error) {
console.error(error.message);
//alert('Failed to create new object, with error code: ' + error.message);
},
useMasterKey: true
})

Resources