profile
viewpoint
Rui Peres RuiAAPeres London, UK https://twitter.com/peres Software Engineer 🛠| Caustic 🔥 | Aspiring Farmer 🥕 | Ultra Trail Runner 🏃‍♂️🏔 "Technology as a means to an end 🚀" -

Krisiacik/ImageViewer 2300

An image viewer à la Twitter

RACCommunity/Rex 232

ReactiveCocoa Extensions

RACCommunity/RACNest 136

RAC + MVVM examples :mouse::mouse::mouse:

andersio/Cycler 72

[Archived] Unidirectional data flow architecture with SwiftUI and Combine.

RuiAAPeres/8472 5

Strava client, with focus activities analysis. 🏃‍♂️

RuiAAPeres/awesome-ios 1

A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

dsaliberti/dashboardpush 0

webhook trigger app

RuiAAPeres/ACHNBrowserUI 0

Animal Crossing New Horizon companion app in SwiftUI

startedSwiftUIX/SwiftUIX

started time in a day

push eventRuiAAPeres/RuiAAPeres

Rui Peres

commit sha fcc1b45e97f7864e609bf1c5558aa007e4523039

Update README.md

view details

push time in a day

push eventRuiAAPeres/RuiAAPeres

Rui Peres

commit sha 93ace17b46ce147cf7fd62e0ff172f44c7d3d014

Update README.md

view details

push time in a day

create barnchRuiAAPeres/RuiAAPeres

branch : master

created branch time in a day

created repositoryRuiAAPeres/RuiAAPeres

created time in a day

issue commentbugsnag/bugsnag-cocoa

Logging messages

Hi @phillipsam

I think I didn't explain myself clearly.

There are legitimate cases where, although there's no error or exception, I would still like to send logs. Hence why i gave the notify(message: String) as an example. For instance, if I want to log the main thread load and keep an eye on that, how would you recommend doing so with your lib?

Thank you

RuiAAPeres

comment created time in 4 days

issue openedbugsnag/bugsnag-cocoa

Logging messages

Description

I would like to start logging system metrics (e.g. request/response times, main thread load) and none of the notify family methods seems to be a good fit to log these.

I would like for a new method to be introduced: notifiy(message: String). This would belong to the notify methods family: By default the severity of events generated by this method are set to .info.

Thank you.

created time in 6 days

issue commentbugsnag/bugsnag-cocoa

Breadcrumb API is not thread-safe

Any luck on this?

dtorres

comment created time in 7 days

push eventRuiAAPeres/ruiaaperes.github.io

Rui Peres

commit sha 638e36cb1d2dab4ae58ec60a91a11971dcabfb59

Set theme jekyll-theme-minimal

view details

push time in 8 days

issue commentgetsentry/sentry-cocoa

Missing Crashlog Symbolication in 5.x.x (Ad-hoc distribution)

@philipphofmann I tried with:

let exception = NSException(name: .genericException, reason: "Something bad happened", userInfo: nil)
SentrySDK.capture(exception: exception)

Using 5.1.6 and it looks like this: https://sentry.io/share/issue/3d6e42fe35eb406593720c1a0ae99345/

ostatnicky

comment created time in 9 days

issue openedgetsentry/sentry-cocoa

Crash reports lacking detail

Platform:

  • [X] iOS
  • [ ] tvOS
  • [ ] MacOS
  • [ ] watchOS

Swift:

  • [X] Yes - 5.2.4
  • [ ] No

sentry-cocoa installed with:

  • [X] CocoaPods
  • [ ] Carthage
  • [ ] Manually

Version of sentry-cocoa: 5.1.6


I have following issue:

Let's start by my setup:

          SentrySDK.start { options in
            options.dsn = environment.sentryDSN
            options.enableAutoSessionTracking = true
            options.environment = environment.name
            options.releaseName = "iOS \(versionNumber) (\(buildNumber))"

            #if DEBUG
            options.debug = true
            #endif
          }

The crash report on the Sentry dashboard is not consistent across the same exception. Given the following code:

func please_crash() {
   let array: [String] = []
   array.first!
}

I am receiving different reports details for the same crash:

image

  1. The first crash is on release build using TF (TestFlight).
  2. The second crash is on debug build running on a real device.

You can find the shared report for the TF build here: https://sentry.io/share/issue/4b83322571f14fc4886bda2cce108f8b/ And for the debug version here: https://sentry.io/share/issue/a62617bf2736465db3f68dfac79869bc/

Although not symbolicated, the debug version is able to provide me more information than the symbolicated TF one.

Am I doing something wrong?


On a different account, the crash report doesn't really help by showing, by default, the thread's stack where Sentry is running:

image

Could you please either not show this at all, or show the stack where the crash occurred by default?

created time in 9 days

issue commentgetsentry/sentry-cocoa

Missing Crashlog Symbolication in 5.x.x (Ad-hoc distribution)

On the same code I run the test crash with different SentrySDK version with this crashlog result:

SentrySDK 5.1.4: https://sentry.io/share/issue/2e8aac5663cb4af2913822765987762c/ SentrySDK 4.5.0: https://sentry.io/share/issue/a35d42323e034001abcebb54add16daf/

I am curious about what's happening here. @philipphofmann do you think this might be an SDK regression?

ostatnicky

comment created time in 9 days

startedjordansinger/mail-swiftui-sample

started time in 10 days

PR opened Dimillian/ACHNBrowserUI

Fix retain cycle and VM recreation

What

This PR addresses two issues with the VillagersViewModel. In particular with its recreation whenever SwiftUI dictates so and the implicit use of self as part of its implementation.

How

  1. Make self weak and avoid the map's closure capturing self.
  2. Use StateObject instead of ObservedObject. Although I am not particular fond of this approach, it fixes the problem where VillagersViewModel is being recreated every time the user switches tab on TodayBirthdaysSection.

This problem can be seen here:

Before After (with this PR)
before after

We can also see the memory growing with the implicit self capture:

Before After
image image
+2 -2

0 comment

2 changed files

pr created time in 11 days

create barnchRuiAAPeres/ACHNBrowserUI

branch : rui/FixRetainCycle

created branch time in 11 days

startedairbnb/HorizonCalendar

started time in 21 days

issue commentgroue/GRDB.swift

Deeply nested Fetch Association

Hi @groue thanks for the detailed answer. I am struggling with this piece:

                .including(optional: RecordB.recordD
                    .forKey(RecordBInfo.recordDInfoKey)

Unfortunately, I get an error while exposing the CodingKey:

static let recordDInfoKey = CodingKeys.recordDInfo // exposed

Property must be declared private because its type 'RecordBInfo.CodingKeys' uses a private type. And I am not able to expose it.

RuiAAPeres

comment created time in a month

issue openedgroue/GRDB.swift

Deeply nested Fetch Association

What did you do?

Currently I have a setup similar to the following:

struct InfoX: FetchableRecord, Decodable {
    struct InfoY: Decodable {
        struct InfoZ: Decodable {
          var recordD: RecordEntityD
          var recordsE: [RecordEntityE]
    }

    var recordB: RecordEntityB
    var recordC: RecordEntityC?
    var infoZ: InfoZ?
  }

   let recordA: RecordEntityA
   let infoY: [InfoY]
}

The relationship in the schema goes like this:

RecordA 1----N RecordB
RecordB 1----1 RecordC
RecordB 1----1 RecordD
RecordD 1----N RecordE

InfoX, InfoY, InfoZ, follow the same approach as your example here. While recordA, recordB, recordC, recordD and ``recordEconform with the protocolPersistableRecordandFetchableRecord`.

My question is, how could I fetch all this data using a single association chain? I have tried a couple of things, but ultimately, only RecordEntityA and an array of RecordEntityB are available after doing:

  static func all() -> QueryInterfaceRequest<SpherePayloadFetcher> {
    RecordEntityA
            .including(all:
              RecordEntityA.recordB.forKey(CodingKeys.infoY)
                .including(optional: RecordEntityB.recordC)
                .including(optional: RecordEntityB.recordD)
              )
            .asRequest(of: InfoX.self)
  }

Is this even the right setup (from a compounded FetchableRecord point of view)?

Environment

GRDB flavor(s): GRDB GRDB version: 5.0.0beta2 Installation method: CocoaPods Xcode version: Version 11.5 (11E608c) Swift version: 5.2.2 Platform(s) running GRDB: iOS macOS version running Xcode: 10.15.3 (19D76)

Demo Project

N/A.

created time in a month

issue commentgroue/GRDB.swift

Observing Database writes (via Reactive bindings)

@groue thank you so much for the detailed response. Your assessment is correct and the problem is within my own ViewModel, that, at the point of creation, it immediately reads from the Database. Given that it's empty, it rightfully emits an empty array. The following test, using two ViewModels solves the problem:

/// viewModel1's purpose is to add an entity into the DB, nothing else
viewModel1.add(entity).startWithCompletion {
 let viewModel2 = ...
 viewModel2. observe { values in 
 //  Assertion ...
  }
}
RuiAAPeres

comment created time in 2 months

issue openedgroue/GRDB.swift

Observing Database writes (via Reactive bindings)

What did you do?

Currently testing the behaviour of a ViewModel. Said ViewModel has the following (roughly speaking) signature:

protocol ViewModel {
   func add(entity: Entity) -> SignalProducer<Never, Error>
   func observe() -> SignalProducer<[Entity], Never>
}

The consumer of said API can add an Entity and observe changes in the ViewModel via the observer. SignalProducer aren't much different than an Rx Observable and I am currently using these extensions. Internally, the ViewModel compliant entity is running with a DatabasePool. I am also using the asyncWrite version for adding the Entity and using the ValueObservationScheduler = .immediate for the observation. I believe that this is likely the cause for this problem.

What did you expect to happen?

I wanted to test the following scenario:

  1. Assuming an empty ViewModel (and corresponding Database).
  2. If a user inserts an Entity I can observe said Entity being sent via observer.

The setup looks like this:

viewModel.add(entity).ignoreError()
.then(viewModel.observe)
.startWithValues { values in

}

What I receive (in the startWithValues handler`) is first an empty array and then an array with the entity I inserted. My expectations, was to receive the array with an entity, since I only start the observation after the entity is added.

What happened instead?

Instead I first receive an empty array and then an array with the inserted entity.

Environment

GRDB flavor(s): GRDB GRDB version: 5.0.0beta2 Installation method: CocoaPods Xcode version: Version 11.4.1 (11E503a) Swift version: Platform(s) running GRDB: (iOS, macOS, watchOS?) macOS version running Xcode: 5.2.2

Demo Project

<!-- Please link to or upload a project we can download that reproduces the issue. -->

created time in 2 months

push eventRuiAAPeres/ruiaaperes.github.io

Rui Peres

commit sha 4dc71c8a55d186427d37dd1e6835ff7c3a8bf3ed

Update _config.yml

view details

push time in 2 months

push eventRuiAAPeres/ruiaaperes.github.io

Rui Peres

commit sha c23876cf9a5750c8253f8846b9085d3a0d2636ae

Update _config.yml

view details

push time in 2 months

starteddillonkearns/elm-pages

started time in 2 months

create barnchRuiAAPeres/b

branch : master

created branch time in 2 months

created repositoryRuiAAPeres/b

created time in 2 months

startedgoogle/swift-benchmark

started time in 2 months

pull request commentReactiveCocoa/Loop

Feedback designated initializer changes + `Feedback(source:as:)`.

@sergdort thank you for your answer. Could you elaborate on these advance cases? I had a look at the header of the method, but I couldn't understand the apples example.

andersio

comment created time in 2 months

starteddaltoniam/Starscream

started time in 2 months

pull request commentReactiveCocoa/Loop

Feedback designated initializer changes + `Feedback(source:as:)`.

My frame of though is set on the previous RAF approach using Property as the starting point. A typical Feedback, under that system, would return a SignalProducer where its SignalProducer.Value would be an Event. There were ofc many variants and among them:

    public init(events: @escaping (Scheduler, Signal<State, Never>) -> Signal<Event, Never>) {

public init<U, Effect: SignalProducerConvertible>(
        deriving transform: @escaping (Signal<State, Never>) -> Signal<U, Never>,
        effects: @escaping (U) -> Effect

The new approach, seems to use the output as the escape hatch, where one funnels whatever is processed into said output via .enqueue. This begs two questions:

  1. Why this design versus the previous one? Is this tied to the new reducer's signature?
  2. What would happen if for some reason I forgot to .enqueue(to: output)?
andersio

comment created time in 2 months

pull request commentReactiveCocoa/Loop

Feedback designated initializer changes + `Feedback(source:as:)`.

    Feedback { state, output in
        state
            .diff()
            .flatMap(.concat, processDiff)
            .enqueue(to: output)
    }

What's output?

andersio

comment created time in 2 months

startedRACCommunity/Loop

started time in 2 months

issue openedbabylonhealth/ReactiveFeedback

SwiftUI + RAF == ❤️

Hello good people. I downloaded the work that @andersio did here https://github.com/ReactiveCocoa/ReactiveSwift/pull/776 and added the following extension to the Store:

@available(iOS 13.0, *)
extension Store: ObservableObject {
  public var objectWillChange: ProducerPublisher<Context<State, Event>, Never>  {
    self.state.producer.publisher()
  }
}

This seemed to be enough to power a small SwiftUI view:

struct ContentView: View {

  @ObservedObject var store: Store<Counter.State, Counter.Event>

    var body: some View {
      VStack {
        Text("\(store.state.value.count)")
      Button(action: {
        self.store.send(event: .increment )
      }, label: {
        Text("Increment")
      })
      }
    }
}

How do you think we could move this forward? ❤️

created time in 2 months

pull request commentnhsx/COVID-19-app-iOS-BETA

Add missing super invocations

LGTM 👍

mttcrsp

comment created time in 2 months

fork RuiAAPeres/COVID-19-app-iOS-BETA

Source code of the Beta of the NHS COVID-19 iOS app

https://covid19.nhs.uk/

fork in 2 months

startednhsx/COVID-19-app-iOS-BETA

started time in 2 months

startedpointfreeco/swift-composable-architecture

started time in 2 months

more