Google spreadsheet API not responding since July 29 EDT - google-sheets

I am using Googlespreadsheet API, it hangs for ever on this method:
spreadSheetEntry.getWorksheets();
It works before 12:00 pm, July 29 EDT, failed sometime around 13:00 pm
Code:
String feedUrlStr = feedUrl.toString() + "?title-exact=false&title=" + URLEncoder.encode(query);
feedUrl = new URL(feedUrlStr);
this.SpreadSheetFeed = this.service.getFeed(feedUrl, SpreadsheetFeed.class);
this.SpreadSheets = this.SpreadSheetFeed.getEntries(); //it works here,can find spreadsheet.
it hangs when trying to get worksheets.
this.SpreadSheets.get(sheetindex).getWorksheets();//hangs on the function getWorksheets();

I'm getting the same thing when hitting the https://spreadsheets.google.com/feeds/worksheets/key/private/full URL directly.
It is still documented here: https://developers.google.com/google-apps/spreadsheets/?hl=en#sheets_api_urls_visibilities_and_projections - didn't see any sings that it would be deprecated...

Related

Problem with messages if unanswered of out of business hours

Edit: resolved. Another question - how to play mp3 message in case of no answer after 30 sec?
I stucked with twilio settings.
We need to play mp3 message (because our language is not supported by twilio).
This is actual function (I followed manual from blog https://www.twilio.com/blog/2018/06/custom-javascript-twilio-functions-code-studio-flows.html)
exports.handler = function(context, event, callback) {
// With timezone:
// In Functions/Configure, add NPM name: moment-timezone, version: 0.5.14
// Timezone function reference: https://momentjs.com/timezone/
let moment = require('moment-timezone');
//
// timezone needed for Daylight Saving Time adjustment
let timezone = event.timezone || 'Europe/Vienna';
console.log("+ timezone: " + timezone);
//
const hour = moment().tz(timezone).format('H');
const dayOfWeek = moment().tz(timezone).format('d');
if ((hour >= 9 && hour < 17) && dayOfWeek <= 7) {
// "open" from 9am to 5pm, PST.
response = "open";
} else {
response = "after";
}
theResponse = response + " : " + hour + " " + dayOfWeek;
console.log("+ Time request: " + theResponse);
callback(null, theResponse);
};
I functions configuration, I set moment-timezone version 0.5.26 (but also tried 0.5.14), and twilio 3.37.1 (also older version = no sucess)
And this is studio flow used:
I also tried this flow, but no success:
If I calling to our twilio number out of business hours, it does not play out of business message, but it play message before call and then connect to out twilio number.
Thank you for advice and help (dummy here)
I found the mistake.
Box "Access control" was checked, that's why this flow does not worked.
After unchecking, it works.
Another question here - how I can play mp3 message in case of no answer after 30sec? Thank you
image 1
Set your Connect Call To widget timeout to 30 seconds and check the DialStatus of this Connect Call To widget using the follow-up Split Based On widget, to see if the value was other than completed and if so, play .mp3 using the Say/Play widget. Watch out for the far-end having voice mail enabled, which may pickup before 30 seconds.

Setting lastUpdated of a Grails domain object in Spock

I have a Grails 2.2.4 project, and I'm trying to write a unit test for a method that queries over lastUpdated, like so:
Tile.createCriteria().list {
lt('lastUpdated', new Date() - 1)
}
This method works fine in real life, but fails in my unit tests because I can't create any test data with lastUpdated other than now. Setting myTile.lastUpdated explicitly doesn't work, since that's an update and thus triggers the auto-timestamping. Turning off auto timestamping requires the eventTriggeringInterceptor, which doesn't seem to be available in unit tests. Mocking the default Date constructor to return other values was also no help. Direct SQL updates are not available in unit tests at all.
Is this possible in unit tests at all, or do I have to write an integration test?
It's interesting that you say mocking the default date constructor to return other values is no help. I successfully do that quite often when I have queries such as yours that new up a date.
For your situation, I would have a unit test that looked something like this:
def 'test lastUpdated query'() {
setup:
Title lessThan = new Title(lastUpdated:new Date(1477152000000)) //22 Oct 2016 16:00 UTC, should be found
Title equalTo = new Title(lastUpdated:new Date(1477238400000)) //24 Oct 2016 16:00 UTC, should not find, not less than 1 day before, but equal to 1 day before
Title notLessThan = new Title(lastUpdated:new Date(1477296000000)) //24 Oct 2016 08:00 UTC, should not find, not less than 1 day before
Date date = new Date(1477324800000) //24 Oct 2016 16:00 UTC
Date.metaClass.constructor = {-> return date}
when:
List<Title> result = service.someMethod()
then:
result.size() == 1
result.contains(lessThan)
!result.contains(equalTo)
!result.contains(notLessThan)
}

Save task with a specific date and timezone

It's a rails project. I have a form where the user can schedule tasks. For the moment I get the timezone of the browser with :
var currentTime = new Date();
var timezone_offset = currentTime.getTimezoneOffset()
And then I use it in my controller. But the problem is :
How can I save the date to be scheduled to the right moment?
I thought the answer will be to parse the date from my form and then change the offset but it doesn't work:
> time = Time.parse("2015/11/30 12:00")
=> 2015-11-30 12:00:00 +0100
> time.change(offset: '+02:00')
=> 2015-11-30 12:00:00 +0100
Maybe the answer is to create a Time.new?
My heroku server is on UTC. Some users on CET.
You would be better off getting your form to submit the time in UTC format.
Using something like moment.js (http://momentjs.com/) you can get their local time in the browser and display the date/time in their local format, but submit the UTC counterpart to the server when submitting your form.

Titanium Mobile local notifications at a certain time

I have been trying to setup local notifications with Titanium mobile for iOS, using a custom date time, but its not working with custom date time. What I am trying is
var notification = Ti.App.iOS.scheduleLocalNotification({
alertBody:"Dummy text",
alertAction:"Re-Launch!",
userInfo:{"hello":"world"},
date: new Date("2015-03-22 01:45")
});
However when I use this for date, It works.
date: new Date(new Date.getTime()+8000)//Current date time + 8 secs after.
What should I do to make this work.
date: new Date("2015-03-22 01:45")
Thanks.
The date string you are passing to the constructor is not valid.
You could use something like:
date: new Date("1/20/2015 00:00:00")
Where the format is MM/DD/YYYY HH:MM:SS

DateTime from WebApi to Breeze is transformed with the Time Localization

I have a form on which I set a start Date and a finish Date for a entity.
On the Web Api side, before saving the date to the database,I set the start date: 2013-09-25 00:00:00.000 and the the end date as 2013-09-26 23:59:59.000.
var vote = (VotingSet)Entity;
vote.Start = new DateTime(vote.Start.Year, vote.Start.Month, vote.Start.Day, 0, 0, 0, 0);
vote.End = new DateTime(vote.End.Year, vote.End.Month, vote.End.Day, 23, 59, 58);
This is from the JSON that is send to the rest service looks like this:
Start: "2013-09-25T00:00:00.000Z"
End: "2013-09-26T00:00:00.000Z"
After the save, in the javascript client, the entity is updated with the new key and with the properties that come from the server.
The observable date objects will have the following value
Start: Wed Sep 25 2013 03:00:00 GMT+0300 (GTB Daylight Time)
End: Fri Sep 27 2013 02:59:58 GMT+0300 (GTB Daylight Time)
This is what i am getting back from the server
Start: "2013-09-25T00:00:00.000"
End: "2013-09-26T23:59:58.000"
How can i make sure that the hours in my object are not modified?
EDIT:
There is a a good explaniation here on what's happening with the datetime in javascript.
In the end i used this snipped to solve my problem:
breeze.DataType.parseDateFromServer = function (source) {
var date = moment(source);
return date.toDate();
};
It override's breeze own function with adds a time offset to the datetime.
Breeze does not manipulate the datetimes going to and from the server in any way EXCEPT to add a UTZ timezone specifier to any dates returned from the server that do not already have one. This is only done because different browsers interpret dates without a timezone specifier differently and we want consistency between browsers.
This is discussed in more detail in the answer posted here.
You are passing ISO8601 formatted timestamps, which is good. When you pass the Z at the end, you are indicating that the timestamp represents UTC. When you load those into JavaScript, it's going to take that into account.
You still need to show more code if you are looking for a useful response. What you've currently described from .NET doesn't quite line up with the timestamps you've provided. And it seems like most of this problem has to do with JavaScript and you haven't yet shown any of that code, so I can only guess what you might be doing. Please update your question, and understand that we have no knowledge of your system other than what you show us.
It's possible you may find moment.js to be useful in this scenario, but I can't elaborate further without seeing the relevent JavaScript code.

Resources