Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Color settings can't pass to the main process #16789

Closed
1 task
Arcanemagus opened this issue Feb 20, 2018 · 2 comments
Closed
1 task

Color settings can't pass to the main process #16789

Arcanemagus opened this issue Feb 20, 2018 · 2 comments

Comments

@Arcanemagus
Copy link
Contributor

Arcanemagus commented Feb 20, 2018

Prerequisites

Description

It looks like color type values aren't being synced properly to the main process after #16628 was merged.

Steps to Reproduce

  1. Open two windows of Atom v1.25.0-beta0+
  2. Have a package that has a type: color setting (eg. atom-material-ui)
  3. Open Developer Tools on the main window
  4. Open theme settings in the second window, and open the atom-material-ui config
  5. Change one of the colors in the second window
  6. Watch the first window fail to validate the color

Expected behavior:

The color setting properly transfers to the main window.

Actual behavior:

The following Error is thrown:

Error: Validation failed at atom-material-ui.colors.abaseColor, {"_alpha":1,"_blue":131,"_green":20,"_red":117} cannot be coerced into a color
    at Function.coerce (C:\temp\atom\src\config.js:1379)
    at Function.executeSchemaEnforcers (C:\temp\atom\src\config.js:389)
    at Function.coerce (C:\temp\atom\src\config.js:1339)
    at Function.executeSchemaEnforcers (C:\temp\atom\src\config.js:389)
    at Function.coerce (C:\temp\atom\src\config.js:1339)
    at Function.executeSchemaEnforcers (C:\temp\atom\src\config.js:389)
    at Config.makeValueConformToSchema (C:\temp\atom\src\config.js:1136)
    at Config.set (C:\temp\atom\src\config.js:702)
    at transact (C:\temp\atom\src\config.js:953)
    at Config.transact (C:\temp\atom\src\config.js:815)
    at Config.resetUserSettings (C:\temp\atom\src\config.js:950)
    at disposables.add.applicationDelegate.onDidChangeUserSettings.settings (C:\temp\atom\src\atom-environment.js:786)
    at EventEmitter.outerCallback (C:\temp\atom\src\application-delegate.js:194)
    at emitThree (events.js:121)
    at EventEmitter.emit (events.js:197)

From what I can tell so far the bug is that the Color Object from the second window is being emited to the main window... but the problem is that it only has _name properties defined directly on it, the main name properties are all getters. This means that when it gets to the main window all that is left is an Object like {"_alpha":1,"_blue":192,"_green":107,"_red":92} instead of a real Color object. Since that Object isn't a Color object, it fails the schema enforcer for a color setting.

Reproduces how often:

100% of the time.

Versions

This started happening in this version, based on e74ea47:

Atom    : 1.25.0-dev-e74ea4797
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0

A build based on a48624d (right before #16628 was merged) doesn't show this issue:

Atom    : 1.25.0-dev-a48624dc0
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0

OS: Windows 10 x64

Additional Information

This was originally filed at atom-material/atom-material-ui#462, but further investigation showed this to be a bug here.

@winstliu
Copy link
Contributor

/cc @maxbrunsfeld

@lock
Copy link

lock bot commented Aug 20, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Aug 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants