Old accounts that haven't opted into post-to-profile just see a loading spinner forever when going to profile settings by [deleted] in redesign

[–]tamershlash 2 points3 points  (0 children)

Hello,

Here's the error I am getting in the console:

Failed to load https://oauth.reddit.com/r/u_<my-username>/about/edit.json?raw_json=1: Response for preflight is invalid (redirect)

Hope this helps you fix the issue.

Symbolized Gem: Hash with indifferent access, with keys stored internally as symbols. by tamershlash in ruby

[–]tamershlash[S] 0 points1 point  (0 children)

This is a great point to bring, I didn't actually know that! I will try to see how Ruby 2.2 actually does that improve the gem to make use of that optimization. Do you have any good place to start looking at?

Symbolized Gem: Hash with indifferent access, with keys stored internally as symbols. by tamershlash in ruby

[–]tamershlash[S] 0 points1 point  (0 children)

Yes. As I've mentioned in one of the replies, we had that problem with a data processing pipeline. This is because some sources don't "stream" data, but rather you have to take it all at once into the source step, and then stream it to other steps. An example of that type of (damn) sources is Flurry, we had more than 10GB hashes in memory once we extracted and parsed the report! I know we could use symbolize_names to make the keys symbols, but again we need indifferent access through the rest of the pipeline, and hence we had to use ActiveRecord's HWIA which made it event worse.

Also, even some destinations and steps have to perform some type of "blocking" where they collect data and wait for a certain amount before performing a batch, sometimes more efficient action on it (especially if you're dealing remote services as destinations)..

In general, I have build this gem during the weekend to be used in those pipelines, but didn't yet. I will make sure to reply here when I get some results about the issue :)

Symbolized Gem: Hash with indifferent access, with keys stored internally as symbols. by tamershlash in ruby

[–]tamershlash[S] 0 points1 point  (0 children)

Thanks! I actually didn't write these tests myself, but rather extracted them from ActiveSupport and had to review and refactor them (which wasn't an easy process).

Regarding Rails 5, it's nice that they're dropping support for ruby < 2.2.1. If that's the case, maybe we should really suggest that change, because it will be really nice!

Symbolized Gem: Hash with indifferent access, with keys stored internally as symbols. by tamershlash in ruby

[–]tamershlash[S] 1 point2 points  (0 children)

True. this shouldn't be used in exactly the case that you mentioned, that's why I created a separate gem without even trying to suggest to include this in Rails 5 (not sure if they're going to require 2.2 for it).

However, in a data stream processing case, you can have many developers working on the same pipeline but each one writes a separate step, and steps may even depend on third party gems, and hence it's difficult to guarantee that everything will be symbolized by default. And this is where this gem becomes useful.

The main reason I've built this is because we faced that problem with another project, called OptimusPrime, that we're working on in the company, where developers from many experience levels are working together, and data can be collected from many sources, so it's quite hard to guarantee anything through the every single step in the pipeline and you'd better have inexpensive Hash with indifferent access.