Retrieving the set of tabs from a Teams Channel using Graph returns a 500 error - channels

This was working but it is no longer.
Doing this from Graph Explorer:
GET https://graph.microsoft.com/beta/teams/########-####-####-####-########/channels/19:#################thread.skype/tabs
returns:
{"error":{"code":"InternalServerError","message":"Failed to execute request.","innerError":{"request-id":"798c78c3-cdb1-49d5-be35-046e8f82bb17","date":"2020-01-07T16:51:13"}}}

The actual error is caused because I created a channel tab having a non-null ODataType value. This value is instantiated by default when the class is instantiated. When I POST the new tab with the non-null, the tab is created (can be seen in the UI) but returns the "Internal Error". When getting the set of tabs back the Internal Error is also returned. If ODataType is set to null when the tab is created then the channel tab REST call succeeds. Subsequent channel tab enumeration succeed without error.

Related

Angular 4 - BehaviourSubject not returning json data properly

I'm trying to creating a global service in angular app with BehaviorSubject.
I have created a method in this service where I have defined a HTTP get method and loading JSON file.
Now the issue I'm facing is when I'm subscribing this BehaviourSubject as asObservable in any component and assign the result to a particular variable in the typescript file, the HTML template renders this value correctly via structured Directive *ngFor but when I'm trying to get the same value in typescript file, it does not work.
For example;
When I'm trying to print this value
console.log(this.data.boxes.length);
then it gives me an error
[ERROR TypeError: Cannot read property 'length' of undefined]
and when I'm trying to print this value without length
console.log(this.data.boxes);
it gives me a proper value of an array in the console panel.
Now If I change BehaviorSubject to Subject, then its working fine means I am also getting length value.
However, I want to use BehaviorSubject instead of Subject.
What am I doing wrong and how can I achieve it?
Behavior subject is emitting current value to subscriber even if subject next is not called before subscription, in other words:
yours subscription is subscribed to subject before first "next" value. I assume that initial value of behavior subject is undefined or similar, so that first value that is emitted to subscriber is causing error.
Could you check declaration of subject and ensure that initial value is in correct form, like:
public exampleSubject = new BeahviourSubject<yourType[]>(<yourType[]>[]);

getTag() method not properly working for google apps script

What i am doing in writing a script that lets the User interact with a data table. Every series that the user chooses creates a button, and then plots the series on a graph. if the user click the button it rooms the series. All there the data is stored in a hidden JSON string. the columns, or series that the user whats to see are stored in an array that i call index, it is also a hidden JSON string) Each button is connected to its own client handler, which has a
.forTargets(the index i was talking about).setTag(to the corresponding column in the data array)
and they are all connected to the same server handler. So when the button is clicked the client handler sets the tag for the index to the series that it is supposed to be removed. Now the server handler will run it get the index by ID and get the Tag. This is were it goes wrong. The tag is always null.
The first thing i tried was to see if my client handler was not working properly. So i set the tag of the index to some number, but the getTag method in the Server handler still returned null.
idk, but maybe Tags are not saved in the UI instance??
Below is the first bit of the Server handler.
function clickServer(e) {
e = e.parameter;
var app = UiApp.getActiveApplication();
var master = JSON.parse(e.dataTable, "reviver");
var index = JSON.parse(e.index, "reviver");
var hidden = app.getElementById("hiddenIndex");
var tag = hidden.getTag();
I think the issue you are meeting is more related to timing : handlers are called simultaneously, this is true for client an server handlers as well, that means that if the client handler changes a hidden tag value this change happens too late for the server handler function to 'see' it. What you should do is create a separate button to trigger the server handler that the user would use after all the other parameters where set.
This very same method is used in the known workaround used to get radioButtons value
Also, why do you use tags on the hidden widget ? you could use it with direct access by setValue() and e.parameter.hiddenName since they are already invisible by nature... ?
Note also that you can set a value in client handlers as long a these values are defined inside the Ui instance (the do Get function) either by constant variables or by another client Handler in the same function, as shown in the before mentioned example with radioButtons... but that's only a detail.
In this context if you need to get a widget value (inside the doGet function) you should of course use getValue() to get the widget value as no e.parameter is available at this time.
I hope I've been clear enough, re-reading this I'm not very sure but.... just ask if something is missing ;-)
The tags values are passed to handlers via parameters. In this post this fact is explained in details.

"Cannot access a property or method of a null object reference" - very strange error

I am working on an AIR application with 2 windows: One to create a new customer and another to display some information about the customer. On window 1, there is also a textfield to search for a customer by Id or name.
These are the steps to create a new customer:
with an "add" button on window 1, I open window 2.
on window 2, the user completes a form to create a new customer.
the information is saved in a MySQL Database over an HttpService.
The result handler method calls a public function on window 1:
result = "new wWin1().resultSaveCustomer(event)"
This part works well - the new customer Id is received.
In some cases, according customer data, I change the component color - this operation works well, if I load a customer after a using the search field, but if I search directly from the resultSaveCustomer function (after completion of step 3), a message appears:
Cannot access a property or method of a null object reference.
I don't understand why, because all the components in window 1, have an Id name!
Or the property is a label with Id Name.
Thanks for helping me.

LocalStorage with Json.stringify not persisting

In it's simplest form:
localStorage.setItem('index0', JSON.stringify(playerInventory[lootArray[0]]));
var retrievedIndex0 = localStorage.getItem('index0');
console.log('retrieved0:'+retrievedIndex0 ); //Displays correct amount
So I thought it was working, but then if I don't setItem immediately before using getItem, it returns null, or if I setItem, hit F5, 'index0' becomes null...
if(localStorage.getItem('index0') < playerInventory[lootArray[0]]) {
console.log('bingo! ');
localStorage.setItem('index0', JSON.stringify(playerInventory[lootArray[0]])); }
This ^ will output 'bingo!' into the log (in firefox), but the setItem does not update localStorage. If I replay the game it'll be null if I don't setItem again before getItem...
This will fire correctly as well...
var oldscore = localStorage.getItem('index0');
var newscore = playerInventory[lootArray[0]];
if(oldscore < newscore) { console.log('new high score');}
But setItem will not update localStorage....and if I hit f5 and replay the game it'll be null
if(oldscore < newscore) {
console.log('new high score'); //This fires
localStorage.setItem('index0', JSON.stringify(playerInventory[lootArray[0]])); //this doesnt
}
if I go to my main update() loop, and put:
console.log(localStorage.getItem('index0')); //returns null
console.log(localStorage.getItem.index0); //returns undefined
Anyone see anything wrong, or have any other tests I could do?
playerInventory[lootArray[0]] is holding the number that I want to use compare with localstorage and update to localstorage when it's higher....I use that object to update divs on my screen with the current value so I know it's holding the integer that I want to save/restore.................................
I just tested in IE and it doesn't work at all it errors: Even the basic first part at the top of this post throws the error.
SCRIPT5007: Unable to get value of the property 'getItem': object is
null or undefined
I can set the item in the same function before using getItem and it's not null obviously at that moment but it doesn't persist beyond that point......
I was having similiar issues with this error when I was working on a project. I've noticed that when I attempted to just run my file, I would keep getting the error of being null or undefined. Once I put my project on a server, it worked.
Also, you already have a variable for the retrieved index. Try using that for your checks, then, if the score is higher, set the new score, if not, set the retrieved index back into local storage.
A note for IE, if you're getting errors when trying to getItem, IE won't go pass the errors in the current method/function. When trying to getItem in IE, throw a try catch around it.
I hope this can help.
Also, try using
localStorage.setItem('index0', JSON.stringify(newscore));
since you already have the variable created.

object required error

Can anyone tell me the reason for this error message in report manager? My report works fine in tool. My second parameter is cascaded (derived from) to the first parameter.
When I run the report for first time it works, but when immediately change any other parameter and try to execute it gives me no data in the result and the web page shows this error:
Line: 13
Char: 692
Error: Object Required
Code: 0
Why do I receive this error?
Sounds like Javascripts version of a NullReferenceException. If that is the case, there are a billion different reasons why this could happen.