Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promoted news card loads the landing page rather than what its linked to #17584

Closed
srirambv opened this issue Aug 20, 2021 · 16 comments
Closed

Comments

@srirambv
Copy link
Contributor

Description

Promoted news card loads the landing page rather than what its linked to

Steps to Reproduce

  1. Enable Brave News
  2. Scroll down to promoted content
  3. Mouse over the promoted text shows it as a link to https://brave.com/brave-today
  4. Click on promoted button, loads the actual card link doesn't load what its linked to
  5. Right click on the Promoted button and open link in a new tab, loads https://brave.com/brave-news

Actual result:

Promoted.Content.Hyperlink.mp4

Expected result:

Clicking promoted news button should load https://brave.com/brave-news and also update the hard-coded link

Reproduces how often:

Easy

Brave version (brave://version info)

Brave 1.28.106 Chromium: 92.0.4515.159 (Official Build) (64-bit)
Revision 0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52-refs/branch-heads/4515@{#2052}
OS Linux

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? NA
  • Does the issue resolve itself when disabling Brave Rewards? NA
  • Is the issue reproducible on the latest version of Chrome? NA

Miscellaneous Information:

cc: @petemill @simonhong

@abhiklodh
Copy link

Can I give this a try?
I think the fix should be relatively straightforward but making sure nothing else breaks is trickier.

@bsclifton
Copy link
Member

@abhiklodh sure thing - let us know if you have any issues setting up, etc

@abhiklodh
Copy link

@bsclifton While running npm run init I came across this issue:-

...
weblayer/public/java/AndroidManifest.xml
  - Patch applied because: The target file was modified since the patch was last applied.
---------------------------------------------------------------------------------------------------------------------------------------
Done applying patches.
Running gclient hooks...
---------------------------------------------------------------------------------------------------------------------------------------
/Volumes/Work/brave-browser
> gclient runhooks
Running hooks:   5% ( 7/118) nacltools                     
________ running 'python3 src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' in '/Volumes/Work/brave-browser'
INFO: --Syncing nacl_arm_glibc to revision 053185d68ed3b96640f15c4ae457b1ff373c6cac--
INFO: Downloading package archive: binutils_arm_x86_64_apple_darwin.tgz (1/6)
package_version: Could not download URL (https://storage.googleapis.com/nativeclient-once/object/binutils_arm_x86_64_apple_darwin_b33eac0121acfb07112b84a130824382abab91e2.tgz): No active exception to reraise
Error: Command 'python3 src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' returned non-zero exit status 1 in /Volumes/Work/brave-browser
INFO: --Syncing nacl_arm_glibc to revision 053185d68ed3b96640f15c4ae457b1ff373c6cac--
INFO: Downloading package archive: binutils_arm_x86_64_apple_darwin.tgz (1/6)
package_version: Could not download URL (https://storage.googleapis.com/nativeclient-once/object/binutils_arm_x86_64_apple_darwin_b33eac0121acfb07112b84a130824382abab91e2.tgz): No active exception to reraise

null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] sync: `node ./build/commands/scripts/sync.js "--init"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] sync script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/abhiklodh/.npm/_logs/2021-08-20T12_12_31_184Z-debug.log
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] init: `node ./scripts/init.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] init script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/abhiklodh/.npm/_logs/2021-08-20T12_12_31_223Z-debug.log
abhiklodh@192 brave-browser % 

2021-08-20T12_12_31_184Z-debug.log

2021-08-20T12_12_31_223Z-debug.log

It was quite sad to see the entire process fail since it took me more than 4 hours for the complete chromium repo to download.

I also manually tried to check if the url:- https://storage.googleapis.com/nativeclient-once/object/binutils_arm_x86_64_apple_darwin_b33eac0121acfb07112b84a130824382abab91e2.tgz was opening in Safari or not to rule out weird ISP issues and it was opening just fine.

I also wanted to confirm one thing. For the sole purpose of me keeping the ability to contribute my forked repo in mind, I followed:-

git clone [email protected]:brave/brave-browser.git
cd brave-browser
npm install

# this takes 30-45 minutes to run
# the Chromium source is downloaded which has a large history
npm run init

And after this successfully runs, I intended on running these sets of commands:-

# root where project is cloned
cd ~/brave-browser/
git remote add abhiklodh [email protected]:abhiklodh/brave-browser.git
git fetch abhiklodh
# root for the `brave-core` repo
cd src/brave
git remote add abhiklodh [email protected]:abhiklodh/brave-core.git
git fetch abhiklodh

And then I planned on trying to fix the issue #17584 as mentioned above.
Once I fix the npm run init errors that I'm getting, will this order of execution of commands be the correct way to go about doing this?

I'm running a Dual Core MacBook Pro on macOS 11.5.2 with Node v12.22.5 and NPM 6.x.
Any help is greatly appreciated and I apologise for my lack of know how since this is my first time trying to contribute and edit such a massive scale project/product and I am looking forward to more such opportunities (once I manage to get past my noob errors).

@abhiklodh
Copy link

Funnily enough, all the issues I'm coming across seem to be python issues.
For the first error that I got, I manually ran python src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract (NOTE:- python refers to python 2.7 and python3 refers to 3.8.2 but idk why Python 2.7 seemed to eliminate this issue.
After this, I got this issue:-

Done applying patches.
Running gclient hooks...
---------------------------------------------------------------------------------------------------------------------------------------
/Volumes/Work/brave-browser
> gclient runhooks
Running hooks:  13% (16/118) mac_toolchain                 
________ running 'python3 src/build/mac_toolchain.py' in '/Volumes/Work/brave-browser'
Traceback (most recent call last):
  File "src/build/mac_toolchain.py", line 25, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Error: Command 'python3 src/build/mac_toolchain.py' returned non-zero exit status 1 in /Volumes/Work/brave-browser
Traceback (most recent call last):
  File "src/build/mac_toolchain.py", line 25, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] sync: `node ./build/commands/scripts/sync.js "--init"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] sync script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/abhiklodh/.npm/_logs/2021-08-20T13_02_43_313Z-debug.log
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] init: `node ./scripts/init.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] init script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/abhiklodh/.npm/_logs/2021-08-20T13_02_43_401Z-debug.log

This appears to be an issue with running the python3 src/build/mac_toolchain.py command and after multiple tries with multiple python versions, I couldn't get this to run.
I kept getting

Traceback (most recent call last):
  File "src/build/mac_toolchain.py", line 25, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

@abhiklodh

This comment has been minimized.

@abhiklodh

This comment has been minimized.

@abhiklodh
Copy link

abhiklodh commented Aug 21, 2021

I finally managed to fix the errors by switching to an iMac.
I found the fix to the issue #17584 too but I'm having trouble building the code.
Clearly my journey to fixing this issue has been a rollercoaster one so I'll keep at it. I'm certain I'll get it done.
This is the issue I'm facing while building:-

[17560/52404] COPY_BUNDLE_DATA gen/chrome/browser/ui/cocoa/notifications/alert_notification_xpc_service_info_plist.plist AlertNotificationService.xpc/Contents/Info.plist
FAILED: AlertNotificationService.xpc/Contents/Info.plist 
rm -rf AlertNotificationService.xpc/Contents/Info.plist && /bin/cp -Rc gen/chrome/browser/ui/cocoa/notifications/alert_notification_xpc_service_info_plist.plist AlertNotificationService.xpc/Contents/Info.plist
cp: AlertNotificationService.xpc/Contents/Info.plist: clonefile failed: Operation not supported
[17565/52404] CXX obj/components/policy/proto/proto_internal/device_management_backend.pb.o
ninja: build stopped: subcommand failed.
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node ./build/commands/scripts/commands.js build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/anuplodh/.npm/_logs/2021-08-21T07_49_30_260Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `npm --prefix src/brave run build --`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/anuplodh/.npm/_logs/2021-08-21T07_49_30_296Z-debug.log

@abhiklodh
Copy link

I think I have finally managed to find a solution to my previous issue. Since the local repo while building was getting so big, I switched all the files to my external SSD but it was HFS Extended formatted, which was giving me the clonefile failed: Operation not supported error, so I created an APFS partition and the build is running fine so far (and by fine, it is around 90 GB and has been running for 6 hours).

On an unrelated note, is testing the code by building it all by myself really necessary to submit a PR (since I already hopefully found the fix to the issue #17584)?

I still am slightly lost on the specific steps I need to follow while maintaining my local git repo keeping contribution in mind so a slight help in that domain would be really appreciated.

@abhiklodh

This comment has been minimized.

@abhiklodh

This comment has been minimized.

@abhiklodh

This comment has been minimized.

@abhiklodh
Copy link

@bsclifton @srirambv Please confirm if this is indeed the expected behaviour according to the issue.

2021-08-23.23-07-54.mp4

@abhiklodh
Copy link

All these tests ran successfully on my recent commit.

npm run test -- brave_browser_tests
npm run test -- brave_unit_tests
npm run lint
npm run gn_check
npm run tslint
npm run test-unit

@moiz-lakkadkutta
Copy link

@bsclifton if its still unsolved i would like to give it try. can you kindly assign it to me?

@Muneeb2017
Copy link

Can you assign it to me/ ?

@mattmcalister
Copy link

Closing as we're no longer using the promoted content feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants