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

[BUG] In the offline push, there is an inconsistency between the configuration file and the code #2860

Closed
skiffer-git opened this issue Nov 18, 2024 · 2 comments · Fixed by #2861
Assignees
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@skiffer-git
Copy link
Member

OpenIM Server Version

main

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

In the offline push, there is an inconsistency between the configuration file and the code—the configuration file uses "jpns," while the code uses "jpush." Update the code and configuration file to match.

Screenshots Link

No response

@skiffer-git skiffer-git added the bug Categorizes issue or PR as related to a bug. label Nov 18, 2024
@skiffer-git
Copy link
Member Author

enable: geTui
geTui:
pushUrl: https://restapi.getui.com/v2/$appId
masterSecret:
appKey:
intent:
channelID:
channelName:
fcm:

Prioritize using file paths. If the file path is empty, use URL

filePath: # File path is concatenated with the parameters passed in through - c(mage default pass in config/) and filePath.
authURL: # Must start with https or http.
jpns:
appKey:
masterSecret:
pushURL:
pushIntent:

@skiffer-git
Copy link
Member Author

const (
geTUI = "getui"
firebase = "fcm"
jPush = "jpush"
)

// OfflinePusher Offline Pusher.
type OfflinePusher interface {
Push(ctx context.Context, userIDs []string, title, content string, opts *options.Opts) error
}

func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (OfflinePusher, error) {
var offlinePusher OfflinePusher
pushConf.Enable = strings.ToLower(pushConf.Enable)
switch pushConf.Enable {
case geTUI:
offlinePusher = getui.NewClient(pushConf, cache)
case firebase:
return fcm.NewClient(pushConf, cache, fcmConfigPath)
case jPush:
offlinePusher = jpush.NewClient(pushConf)
default:
offlinePusher = dummy.NewClient()
log.ZWarn(mcontext.WithMustInfoCtx([]string{"push start", "admin", "admin", ""}), "Unknown push config", nil)
}
return offlinePusher, nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants