duplicate comments in getstream-io api for swift - getstream-io

Whenever I try to comment on a post in my flat-feed and reload the comment section it. a duplicate set of comment cells is presented so if I have one comment and reload I will now have two duplicate comments. this keeps happening until I close and reopen that comment thread. then it will reset to one comment cell. This is how im setting up the timeline
if let feedId = FeedId(feedSlug: "timeline") {
let timelineFlatFeed = Client.shared.flatFeed(feedId)
presenter = FlatFeedPresenter<GetStreamActivityFeed.Activity>. (flatFeed: timelineFlatFeed, reactionTypes: [.likes, .comments])
}
what the comment section looks like after reloading 3 times

Thank you for the bug report. We fixed this in https://github.com/GetStream/swift-activity-feed/pull/8 and will release it in 2.2.2

Related

Adjusting AVAudioMix volume property has no effect in iOS9

I have an app which loads local files into an avPlayer via a AVMutableComposition, it may have as many as 6 audio and video tracks as part of the composition.
I have a UISlider which is used to adjust the volume of each track in the player.
Below is the code used to update the volume.
- (void)updateVolumeForTake:(Take *)take
{
NSInteger trackID = // method that gets trackID
AVMutableAudioMix *audioMix = self.player.currentItem.audioMix.mutableCopy;
NSMutableArray *inputParameters = audioMix.inputParameters.mutableCopy;
AVMutableAudioMixInputParameters *audioInputParams = [inputParameters filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:kTrackIdPredicate, trackID]].firstObject;
[audioInputParams setVolume:myNewVolumeFloat atTime:myDesiredTime];
audioMix.inputParameters = inputParameters;
AVPlayerItem *playerItem = self.player.currentItem;
playerItem.audioMix = audioMix;
}
This is is currently live in the appStore and has been since iOS6 and has always worked with no issue.
On a device running iOS9, the above no longer works at all. I have looked at the release notes and although there is some mention of AVFoundation, I didn't see anything regarding AVAudioMix.I have googled around and have not found anyone else with this issue.
I also tried creating a new project with nothing but an AVPlayer and UISlider and I saw the same behaviour.
My question is as follows, has anyone else experienced this issue?
Is anyone aware of a known bug related to this?
I have found a solution but unfortunately not an exact cause.
I can't say I fully understand why this fixed my issue but here is the solution and an attempt at explaining why it fixed the issue I was experiencing.
- (void)updateVolumeForTake:(Take *)take
{
AVMutableAudioMix *audioMix = [AVMutableAudioMix audioMix];
NSMutableArray *inputParameters = [self.inputParameters filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:kNotTrackIdPredicate, myTrackID]].mutableCopy;
AVCompositionTrack *track = (AVCompositionTrack *)[self.composition trackWithTrackID:myTrackID];
AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack:track];
[audioInputParams setVolume:myDesiredVolume atTime:kCMTimeZero];
[inputParameters addObject:audioInputParams];
audioMix.inputParameters = inputParameters;
AVPlayerItem *playerItem = self.player.currentItem;
playerItem.audioMix = audioMix;
self.inputParameters = inputParameters;
}
As you can see above, I have stopped using mutable copies of my AVAudioMix and its inputParameters and instead created a new AVAudioMix and NSMutableArray for inputParameters. The new inputParameters array is a copy of the existing inputParameters (referenced from a property 'self.inputParameters') minus the track matching the one I wish to change.
Secondly I create a new instance of AVMutableAudioMixInputParameters using the track with which I wish to edit the volume of (previously I was getting reference to the existing params with matching trackID and modifying them). I edit that add it to my new array and make that the audio mix of currentItem.
Again I can't say with any certainty why this fixes it, but it did for me, I wonder if all the mutable copies were not being discovered as different at all when I reassigned the audioMix of the playerItem and thats why I didn't hear any change in the volume. (although this seems doubtful).
Anyway my issue is fixed and I hope this can help anyone who has a similar issue.

Epoll add button not working?

I'm quite new to meteor and I am having some issues.
I am creating an epoll app and here is the link to it: http://epollhouse.meteor.com/
But, when I press the Add question button nothing happens.
Also, for your reference I have posted my source code up onto github: https://github.com/InfamousGamez/epollhouse
Your problem is in epollclient.js
change this: Questions = new Meteor.Collections("questions");
to this: Questions = new Mongo.Collection("questions");

Is there an example for putting the mediaroutebutton on the action bar?

I have it working with the following code on onPrepareMenuOptions but it doesn't work well.
MenuItem mediaRouteItem = menu.findItem(R.id.media_route_button);
mMediaRouteButton = (MediaRouteButton) mediaRouteItem.getActionView();
mMediaRouteButton.setRouteSelector(mMediaRouteSelector);
mDialogFactory = new SampleMediaRouteDialogFactory();
mMediaRouteButton.setDialogFactory(mDialogFactory);
I was hoping to compare it against some code that wasn't written by guessing what to do.
Thanks.
EDIT: I just converted my code to use what is suggested here https://stackoverflow.com/questions/17911796/displaying-the-mediaroutebutton-for-chromecast-in-the-action-bar and had the exact same issues. And if I leave the code with onCreateOptionsMenu then the button is always disabled.

Guide.ShowSignIn(1, false) Value not in range exception

In a new Xna game I wroted this:
GamerServicesComponent gsc = new GamerServicesComponent(this);
gsc.Initialize();
Components.Add(gsc);
if(!GamerServicesDispatcher.IsInitialized)
GamerServicesDispatcher.Initialize(Services);
And in the Update method
if (Keyboard.GetState().IsKeyDown(Keys.S))
if (!Guide.IsVisible)
Guide.ShowSignIn(1, false); // true doesn't solve it nor 2 or 4 as paneCount
I'm receiving a
Value does not fall within the expected range.
Anybody?
It seems that Guide.ShowSignIn() can't be used anymore. I Don't know the reason nor if it is really true. But I couldn't get it working with ShowSignIn.
The way I had to login was by pressing the Home button.
The Guide will appear and you can simply follow the Guide to login.
Waiting a few frames before calling Guide.ShowSignIn() works for me. I don't call it until my game has loaded all assets and at least I frame has been rendered.

How to add a listener in NLog using Code

Consider NLog is already configured and logging messages to a file, I want to add a listener that will be called each time a message is logged. I read the documentation on NLog but what it says in document doesn't work. Does anyone know how to add a listener using Code in NLog.
Thanks
Maybe the answer to this question will help.
I will repeat the suggested code here:
LoggingConfiguration config = LogManager.Configuration;
var logFile = new FileTarget();
config.AddTarget("file", logFile);
logFile.FileName = fileName + ".log";
logFile.Layout = "${date} | ${message}";
var rule = new LoggingRule("*", LogLevel.Info, logFile);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
logger.Info("File converted!");
I haven't tried it, but if it works for you, you should consider voting up the answer in the linked thread. Note that it is ok if you want to vote my answer up as well.
Have you tried to use MessageCall target ?
The documentation is here:
http://nlog-project.org/wiki/MethodCall_target#Logging_to_a_static_method

Resources